/* CSS VARIABLES FOR MEDICAL THEME */
:root {
    --primary-blue: #0b4c8c;
    --primary-blue-hover: #083b6e;
    --secondary-teal: #0d9488;
    --secondary-teal-hover: #0f766e;
    --accent-sky: #0ea5e9;
    --success-green: #10b981;
    --error-red: #ef4444;
    --bg-light: #f1f5f9;
    --bg-body-app: #ffffff;
    --text-main: #475569;
    --text-heading: #0f172a;
    --border-color: #e2e8f0;
    --border-focus: #0ea5e9;
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

/* RESET & BASE STYLES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    height: 100%;
    height: 100dvh;
    margin: 0;
    font-family: var(--font-sans);
    background: radial-gradient(circle at top right, #e0f2fe, #f1f5f9);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Lock scroll to screen viewport */
}

/* APP SHELL WRAPPER */
.app-shell {
    width: 100%;
    max-width: 480px; /* Perfect smartphone viewport width */
    height: 100%;
    max-height: 850px; /* Max height on desktop to keep device look */
    background-color: var(--bg-body-app);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    position: relative;
    border-radius: 24px;
    border: 6px solid #ffffff; /* Mock phone bezel style on desktop */
}

/* APP HEADER */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    background-color: rgba(11, 76, 140, 0.08);
    color: var(--primary-blue);
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.1;
}

.logo-status {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.header-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.header-security-badge svg {
    color: #22c55e;
}

/* APP BODY */
.app-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: #ffffff;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.app-body::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.app-body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ABOVE THE FOLD TRUST ELEMENT */
.trust-above-form {
    text-align: center;
    padding: 0;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(11, 76, 140, 0.05);
    border: 1px solid rgba(11, 76, 140, 0.1);
    color: var(--primary-blue);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

.trust-badge svg {
    color: var(--secondary-teal);
}

.trust-headline {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 4px;
}

/* FORM STYLING */
.native-app-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 10px 32px 10px 32px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-heading);
    background-color: #f8fafc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 76, 140, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper select:focus + .input-icon {
    color: var(--primary-blue);
}

/* PULSING ANIMATION FOR INPUT ATTENTION */
.pulse-input {
    animation: inputPulse 1.6s infinite ease-in-out;
}

.pulse-input:focus {
    animation: none;
}

@keyframes inputPulse {
    0% {
        border-color: var(--border-color);
        box-shadow: 0 0 0 0 rgba(11, 76, 140, 0);
    }
    50% {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 4px rgba(11, 76, 140, 0.22);
        background-color: #f0f7ff; /* Very noticeable soft blue flash */
    }
    100% {
        border-color: var(--border-color);
        box-shadow: 0 0 0 0 rgba(11, 76, 140, 0);
    }
}


/* SECTION DIVIDER FOR DISEASE TITLE */
.section-divider-title {
    border-top: 1px solid #f1f5f9;
    padding-top: 4px;
    margin-top: 2px;
    margin-bottom: 2px;
    border-left: 3px solid var(--secondary-teal); /* Highlight accent bar */
    padding-left: 8px;
}

.section-divider-title h3 {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--primary-blue);
}

.section-divider-title h3::after {
    content: ' *';
    color: var(--error-red);
}

.textarea-wrapper textarea {
    width: 100%;
    padding: 8px 32px 8px 10px;
    height: 75px;
    border: 1.5px solid rgba(13, 148, 136, 0.35); /* Standout teal border */
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    color: var(--text-heading);
    background-color: #fcfdfd; /* Slightly lighter/cleaner background */
    outline: none;
    resize: none;
    box-shadow: inset 0 2px 4px 0 rgba(13, 148, 136, 0.04); /* Soft depth shadow */
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.textarea-wrapper textarea:focus {
    border-color: var(--secondary-teal);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15); /* Prominent focus glow */
}

.textarea-wrapper textarea::placeholder {
    color: #94a3b8;
}

/* ERROR MESSAGES & INVALID STATES */
.error-msg {
    display: none;
    font-size: 11px;
    color: var(--error-red);
    font-weight: 500;
    margin-left: 2px;
}

.form-group.invalid input,
.form-group.invalid textarea {
    border-color: var(--error-red) !important;
    background-color: #fff5f5;
}

.form-group.invalid .error-msg {
    display: block;
}

.form-group.invalid .input-icon {
    color: var(--error-red);
}

/* OPTIONAL FIELDS ROW */
.form-row-optional {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.optional-input-wrapper input,
.optional-input-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-heading);
    background-color: #f8fafc;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.optional-input-wrapper input:focus,
.optional-input-wrapper select:focus {
    border-color: var(--secondary-teal);
    background-color: #ffffff;
}

/* SUBMIT BUTTON */
.app-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
    margin-top: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-submit-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.app-submit-btn:active {
    transform: scale(0.98);
}

.button-sub-notice {
    font-size: 11px;
    color: var(--success-green);
    text-align: center;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.free-disclaimer-note {
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #065f46;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 10.5px;
    line-height: 1.4;
    margin-top: 2px;
    text-align: center;
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner-svg {
    animation: rotate 2s linear infinite;
    width: 18px;
    height: 18px;
}

.spinner-svg .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.hidden {
    display: none !important;
}

/* BELOW THE FOLD TRUST ELEMENT */
.trust-below-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2px;
}

.trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tg-item {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-heading);
}

.icon-secure {
    color: var(--success-green);
}

.privacy-note {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    line-height: 1.4;
    padding: 0 4px;
}

/* APP FOOTER */
.app-footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    text-align: center;
}

.active-experts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
}

.active-badge-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* SUCCESS MODAL OVERLAY */
.modal-overlay {
    position: absolute; /* Keep overlay constrained to the app viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 380px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    padding: 24px;
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.success-icon-wrapper {
    width: 60px;
    height: 60px;
    background-color: #ecfdf5;
    color: var(--success-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 2px solid #d1fae5;
}

.modal-card h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-info-box {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #64748b;
    font-weight: 500;
}

.info-val {
    color: var(--text-heading);
    font-weight: 600;
}

.text-green { color: var(--success-green); }
.font-semibold { font-weight: 600; }

.modal-close-btn {
    width: 100%;
    background-color: var(--primary-blue);
    color: #ffffff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background-color: var(--primary-blue-hover);
}

/* LIVE TICKER STYLING */
.live-ticker-container {
    background-color: rgba(11, 76, 140, 0.04);
    border: 1px dashed rgba(11, 76, 140, 0.15);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.ticker-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--success-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: tickerPulse 1.6s infinite;
    flex-shrink: 0;
}

@keyframes tickerPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.ticker-text {
    font-size: 11.5px;
    color: var(--text-main);
    line-height: 1.3;
}

.ticker-text strong {
    color: var(--primary-blue);
}

/* PROCESS CHECKLIST STYLING (MODAL) */
.process-checklist {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checklist-item .item-badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.checklist-item.done .item-badge {
    background-color: var(--success-green);
    color: #ffffff;
    border-color: var(--success-green);
}

.checklist-item .item-body {
    display: flex;
    flex-direction: column;
}

.checklist-item .item-body h4 {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.2;
}

.checklist-item .item-body p {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
    margin-top: 1px;
}

/* HORIZONTAL PROCESS FLOW STYLING */
.how-it-works-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(11, 76, 140, 0.03);
    border: 1px solid #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    margin: 2px 0 4px 0;
    gap: 6px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-num {
    background-color: var(--primary-blue);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

.flow-arrow {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: bold;
}

/* INPUT FIELD SUCCESS TICKS */
.success-tick {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-green);
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.textarea-tick {
    top: 12px;
    transform: none;
}

.input-wrapper.valid .success-tick {
    display: flex;
}

.input-wrapper.valid input,
.input-wrapper.valid textarea,
.input-wrapper.valid select {
    border-color: var(--success-green) !important;
    background-color: #f0fdf4; /* Very light green tint for success feedback */
}

/* FAQ ACCORDION MODAL STYLING */
.faq-toggle-btn {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 8px auto 0 auto;
    text-decoration: underline;
    transition: color 0.2s;
}

.faq-toggle-btn:hover {
    color: var(--primary-blue-hover);
}

.faq-card {
    max-width: 400px !important;
    padding: 20px !important;
}

.faq-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
    text-align: left;
}

.faq-item {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    transition: border-color 0.2s;
}

.faq-item.active {
    border-color: var(--primary-blue);
}

.faq-question-btn {
    width: 100%;
    padding: 10px 12px;
    background-color: #f8fafc;
    border: none;
    outline: none;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-heading);
}

.faq-answer-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    background-color: #ffffff;
    transition: max-height 0.2s ease, padding 0.2s ease;
}

.faq-answer-content p {
    font-size: 11.5px;
    color: var(--text-main);
    line-height: 1.45;
}

.faq-item.active .faq-answer-content {
    max-height: 120px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
}

.faq-arrow-icon {
    font-size: 8px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-arrow-icon {
    transform: rotate(180deg);
}

/* RESPONSIVE MEDIA QUERIES (Mobile Native View Mode) */
@media (max-width: 480px) {
    body, html {
        background: #ffffff;
    }

    .app-shell {
        border-radius: 0;
        border: none;
        max-height: 100%;
        height: 100%;
    }
    
    .modal-overlay {
        position: fixed; /* Take full viewport on native mobile */
    }
}
