/* ──────────────────────────────────────────────
   Role Selector Modal — Redesigned
   Expected Health — Sign In / Register flow
   ────────────────────────────────────────────── */

/* Scroll lock */
body.eh-modal-open {
    overflow: hidden;
}

/* ── Backdrop ── */
.eh-role-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
    justify-content: center;
    align-items: center;
}

.eh-role-modal--visible {
    display: flex;
    opacity: 1;
}

/* ── Modal panel ── */
.eh-role-modal__panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    max-width: 480px;
    width: 92%;
    padding: 0;
    position: relative;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.eh-role-modal--visible .eh-role-modal__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Green top accent bar ── */
.eh-role-modal__accent {
    height: 4px;
    background: #047727;
    width: 100%;
}

/* ── Panel inner padding ── */
.eh-role-modal__body {
    padding: 36px 40px 32px;
}

/* ── Close button ── */
.eh-role-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    color: #999;
    padding: 0;
    z-index: 1;
}

.eh-role-modal__close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.eh-role-modal__close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ── Header (logo + title inline) ── */
.eh-role-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    justify-content: center;
}

/* ── Logo ── */
.eh-role-modal__logo {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Title ── */
.eh-role-modal__title {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.25;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.3px;
    text-transform: none !important;
}

/* ── Subtitle ── */
.eh-role-modal__subtitle {
    font-size: 14.5px;
    color: #a0a0a0;
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.4;
    font-weight: 400;
}

/* ── Role cards ── */
.eh-role-modal__cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.eh-role-modal__card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border: 2px solid #c8cdd3;
    border-radius: 14px;
    background: #f5f7f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform, box-shadow;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.eh-role-modal__card:hover {
    border-color: #047727;
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(4, 119, 39, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.04);
    background: #f0faf3;
}

.eh-role-modal__card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(4, 119, 39, 0.12);
}

/* ── Card icon ── */
.eh-role-modal__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf7f0;
    border-radius: 50%;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.eh-role-modal__card:hover .eh-role-modal__icon {
    background: #dff2e5;
    box-shadow: 0 0 0 4px rgba(4, 119, 39, 0.08);
}

.eh-role-modal__icon svg {
    width: 24px;
    height: 24px;
    stroke: #047727;
    stroke-width: 1.75;
    fill: none;
}

/* ── Card text ── */
.eh-role-modal__card-text {
    flex: 1;
    min-width: 0;
}

.eh-role-modal__card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0 0 3px;
    line-height: 1.3;
}

.eh-role-modal__card-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}


/* ── Card arrow ── */
.eh-role-modal__arrow {
    flex-shrink: 0;
    color: #ccc;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.eh-role-modal__arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.eh-role-modal__card:hover .eh-role-modal__arrow {
    color: #047727;
    transform: translateX(4px);
}

/* ── Trust badge ── */
.eh-role-modal__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 12px;
    color: #aaa;
    letter-spacing: 0.02em;
}

.eh-role-modal__trust svg {
    width: 14px;
    height: 14px;
    stroke: #047727;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

/* ── Mobile auth buttons (Astra drawer) ── */
.eh-mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.eh-mobile-auth__sign-in,
.eh-mobile-auth__register {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
}

.eh-mobile-auth__sign-in {
    background: #fff;
    color: #047727;
    border: 2px solid #047727;
}

.eh-mobile-auth__sign-in:hover {
    background: #f0f9f4;
}

.eh-mobile-auth__register {
    background: #047727;
    color: #fff;
}

.eh-mobile-auth__register:hover {
    background: #035e1f;
}

/* ── Mobile responsive ── */
@media (max-width: 480px) {
    .eh-role-modal__body {
        padding: 28px 20px 24px;
    }

    .eh-role-modal__panel {
        width: 95%;
        border-radius: 16px;
    }

    .eh-role-modal__logo {
        width: 30px;
        height: 30px;
    }

    .eh-role-modal__title {
        font-size: 18px;
    }

    .eh-role-modal__subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .eh-role-modal__card {
        padding: 16px;
        gap: 12px;
    }

    .eh-role-modal__icon {
        width: 42px;
        height: 42px;
    }

    .eh-role-modal__icon svg {
        width: 20px;
        height: 20px;
    }

    .eh-role-modal__card-title {
        font-size: 15px;
    }

    .eh-role-modal__card-desc {
        font-size: 12px;
    }

    .eh-role-modal__trust {
        margin-top: 20px;
    }
}

/* ═══════════════════════════════════════════════
   LOGIN FORM VIEW
   ═══════════════════════════════════════════════ */

/* ── Back button ── */
.eh-login__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    transition: color 0.15s ease;
}

.eh-login__back:hover {
    color: #047727;
}

.eh-login__back svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ── Form ── */
.eh-login__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* ── Error ── */
.eh-login__error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 14px;
    padding: 12px 14px;
    line-height: 1.4;
}

/* ── Fields ── */
.eh-login__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eh-login__label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.eh-login__input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    font-size: 15px;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.eh-login__input:focus {
    border-color: #047727;
    box-shadow: 0 0 0 3px rgba(4, 119, 39, 0.1);
}

.eh-login__input::placeholder {
    color: #aaa;
}

/* ── Password toggle ── */
.eh-login__password-wrap {
    position: relative;
}

.eh-login__password-wrap .eh-login__input {
    padding-right: 44px;
}

.eh-login__toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.eh-login__toggle-pw:hover {
    color: #333;
}

.eh-login__toggle-pw svg {
    stroke: currentColor;
    fill: none;
}

/* ── Options row ── */
.eh-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.eh-login__remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    cursor: pointer;
}

.eh-login__remember input[type="checkbox"] {
    accent-color: #047727;
    width: 16px;
    height: 16px;
}

.eh-login__forgot {
    color: #047727;
    text-decoration: none;
    font-weight: 500;
}

.eh-login__forgot:hover {
    text-decoration: underline;
}

/* ── Submit button ── */
.eh-login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #047727;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    margin-top: 4px;
}

.eh-login__submit:hover:not(:disabled) {
    background: #035e1f;
    transform: translateY(-1px);
}

.eh-login__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Loading spinner ── */
.eh-login__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eh-spin 0.6s linear infinite;
}

@keyframes eh-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Register link ── */
.eh-login__register-link {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 16px 0 0;
}

.eh-login__register-link a {
    color: #047727;
    font-weight: 600;
    text-decoration: none;
}

.eh-login__register-link a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   REGISTRATION VIEW
   ═══════════════════════════════════════════ */

/* Widen panel for registration view */
.eh-role-modal__panel.eh-panel--wide {
    max-width: 720px;
}

.eh-register__subtitle {
    text-align: center;
    font-size: 14.5px;
    color: #555;
    margin: -4px 0 18px;
    line-height: 1.5;
}

/* Loading state */
.eh-register__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 12px;
    color: #888;
    font-size: 14px;
}

/* Make the entire registration panel body scrollable */
.eh-panel--wide .eh-role-modal__body {
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.eh-panel--wide .eh-role-modal__body::-webkit-scrollbar {
    width: 6px;
}

.eh-panel--wide .eh-role-modal__body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* ── Gravity Forms in-modal overrides ── */
.eh-register__form-container .gform_wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.eh-register__form-container .gform_wrapper .gform_body {
    padding: 0 !important;
}

.eh-register__form-container .gform_wrapper input[type="text"],
.eh-register__form-container .gform_wrapper input[type="email"],
.eh-register__form-container .gform_wrapper input[type="password"],
.eh-register__form-container .gform_wrapper input[type="tel"],
.eh-register__form-container .gform_wrapper select,
.eh-register__form-container .gform_wrapper textarea {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s !important;
}

.eh-register__form-container .gform_wrapper input:focus,
.eh-register__form-container .gform_wrapper select:focus,
.eh-register__form-container .gform_wrapper textarea:focus {
    border-color: #047727 !important;
    box-shadow: 0 0 0 3px rgba(4, 119, 39, 0.1) !important;
}

.eh-register__form-container .gform_wrapper .gfield_label {
    font-weight: 600 !important;
    font-size: 13.5px !important;
    color: #333 !important;
    margin-bottom: 4px !important;
}

/* Submit button — match Sign In button */
.eh-register__form-container .gform_wrapper .gform_button,
.eh-register__form-container .gform_wrapper input[type="submit"] {
    width: 100% !important;
    background: #047727 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
}

.eh-register__form-container .gform_wrapper .gform_button:hover,
.eh-register__form-container .gform_wrapper input[type="submit"]:hover {
    background: #035e1f !important;
    transform: translateY(-1px);
}

/* Confirmation message */
.eh-register__form-container .gform_confirmation_message {
    text-align: center;
    padding: 24px 16px;
    color: #047727;
    font-size: 15px;
    line-height: 1.5;
}

/* Validation error styles */
.eh-register__form-container .gform_wrapper .validation_error {
    border: 1px solid #c02b2b !important;
    background: #fff5f5 !important;
    color: #c02b2b !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    font-size: 13px !important;
}

.eh-register__form-container .gform_wrapper .gfield_error input,
.eh-register__form-container .gform_wrapper .gfield_error select,
.eh-register__form-container .gform_wrapper .gfield_error textarea {
    border-color: #c02b2b !important;
}

/* Error fallback */
.eh-register__error {
    text-align: center;
    padding: 24px 16px;
    color: #c02b2b;
    font-size: 14px;
}

.eh-register__error a {
    color: #047727;
    font-weight: 600;
    text-decoration: underline;
}

/* Hide GF title/description since we have our own */
.eh-register__form-container .gform_wrapper .gform_title,
.eh-register__form-container .gform_wrapper .gform_description {
    display: none !important;
}

/* Mobile: tighten registration panel height */
@media (max-width: 480px) {
    .eh-panel--wide .eh-role-modal__body {
        max-height: 80vh;
    }
}