/* ============================================================
   EAG Auth Forms — Stylesheet v1.4
   ============================================================ */

.eag-auth-wrap *, .eag-auth-wrap *::before, .eag-auth-wrap *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Wrap: no padding, fills container ───────────────────── */
.eag-auth-wrap {
    width: 100%;
    font-family: var(--e-global-typography-primary-font-family, 'Inter', -apple-system, sans-serif);
}

/* ── Card: zero margin/padding, fills wrap fully ─────────── */
.eag-auth-card {
    width: 100%;
    background-color: #ffffff;
    animation: eag-fade-up 0.3s ease both;
}

@keyframes eag-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ─────────────────────────────────────────────────── */
.eag-auth-logo {
    text-align: center;
    margin-bottom: 20px;
}
.eag-auth-logo img {
    max-height: 64px;
    width: auto;
    display: inline-block;
}

/* ── Tabs Nav ─────────────────────────────────────────────── */
/* Fix #1: transparent background on the nav bar itself */
.eag-tabs-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: transparent;   /* FIX #1 */
    flex-wrap: wrap;            /* FIX #4: wrap on small screens */
}

.eag-tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    text-align: center;
    /* inactive */
    background-color: #ECF2F7;
    color: #003AA5;
}

.eag-tab-btn.eag-tab-active {
    background-color: #003AA5;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,58,165,0.2);
}

.eag-tab-btn:hover:not(.eag-tab-active) {
    background-color: #dce8f5;
}

/* Fix #4: stack tabs on very narrow screens */
@media (max-width: 400px) {
    .eag-tabs-nav {
        flex-direction: column;
    }
    .eag-tab-btn {
        flex: 1 1 100%;
        white-space: normal;
    }
}

.eag-tab-content { display: none; }
.eag-tab-content.eag-tab-active { display: block; }

/* ── Messages ─────────────────────────────────────────────── */
.eag-message {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.eag-message-error   { background:#fff0f1; border:1px solid #ffc2c7; color:#c0392b; }
.eag-message-success { background:#f0faf4; border:1px solid #a8e6c0; color:#1e7e34; }

/* ── Form ─────────────────────────────────────────────────── */
.eag-auth-form { display:flex; flex-direction:column; gap:16px; }

/* ── Field Group ──────────────────────────────────────────── */
.eag-field-group { display:flex; flex-direction:column; gap:6px; }

.eag-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--e-global-color-text, #374151);
    letter-spacing: 0.01em;
}

.eag-required { color: #e53935; }
.eag-optional { color: #9ca3af; font-weight:400; font-size:12px; }

/* ── Two Column — collapses on mobile ────────────────────── */
.eag-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
/* Fix #4: single col on small screens */
@media (max-width: 480px) {
    .eag-two-col { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Input Wrap ───────────────────────────────────────────── */
.eag-input-wrap {
    display: flex;
    align-items: center;
    background-color: #f8fafc;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    overflow: hidden;
    width: 100%;
}
.eag-input-wrap:focus-within {
    background: #ffffff;
    border-color: #003AA5;
    box-shadow: 0 0 0 3px rgba(0,58,165,0.1);
}

.eag-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--e-global-color-text, #111827);
    font-family: inherit;
    width: 100%;
    min-width: 0;
}
.eag-input::placeholder { color: #9ca3af; }

/* Bare input (two-col) */
.eag-field-group > .eag-input {
    background: #f8fafc;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--e-global-color-text, #111827);
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    outline: none;
}
.eag-field-group > .eag-input:focus {
    background: #ffffff;
    border-color: #003AA5;
    box-shadow: 0 0 0 3px rgba(0,58,165,0.1);
}

/* ── Toggle Password ──────────────────────────────────────── */
.eag-toggle-password {
    background: #003AA5;
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    margin: 4px;
    color: #ffffff;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 8px;
    transition: background 0.2s;
    height: calc(100% - 8px);
}
.eag-toggle-password:hover { background: #002d82; }

/* ── Password Strength ────────────────────────────────────── */
.eag-password-strength { display:flex; align-items:center; gap:10px; margin-top:5px; }
.eag-strength-bar      { flex:1; height:4px; background:#e5e7eb; border-radius:99px; overflow:hidden; }
.eag-strength-fill     { height:100%; width:0%; border-radius:99px; transition:width 0.3s,background-color 0.3s; }
.eag-strength-label    { font-size:12px; font-weight:600; min-width:46px; text-align:right; color:#9ca3af; }
.eag-strength-weak   .eag-strength-fill  { width:33%;  background:#e53935; }
.eag-strength-weak   .eag-strength-label { color:#e53935; }
.eag-strength-fair   .eag-strength-fill  { width:66%;  background:#f57c00; }
.eag-strength-fair   .eag-strength-label { color:#f57c00; }
.eag-strength-strong .eag-strength-fill  { width:100%; background:#2e7d32; }
.eag-strength-strong .eag-strength-label { color:#2e7d32; }

/* ── Password Match ───────────────────────────────────────── */
.eag-match-hint            { font-size:12px; margin-top:3px; display:block; min-height:16px; }
.eag-match-hint.match      { color:#2e7d32; }
.eag-match-hint.no-match   { color:#e53935; }

/* ── Remember row ─────────────────────────────────────────── */
.eag-form-row      { display:flex; align-items:center; }
.eag-remember-row  { justify-content:flex-start; }

/* ── Checkbox — thin, small, matches site body text ───────── */
.eag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    /* Match the site's body/paragraph font size exactly */
    font-size: var(--e-global-typography-text-font-size, 14px);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    color: var(--e-global-color-text, #374151);
    line-height: 1.5;
    user-select: none;
}
.eag-checkbox { display: none; }
.eag-checkmark {
    /* Small and thin to match the text weight */
    width: 14px;
    height: 14px;
    border: 1px solid #aab0bb;   /* thin 1px border */
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
}
.eag-checkbox:checked + .eag-checkmark {
    background: #003AA5;
    border-color: #003AA5;
}
.eag-checkbox:checked + .eag-checkmark::after {
    content: '';
    display: block;
    width: 3px;
    height: 6px;
    border: 1px solid #fff;   /* thin 1px tick */
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}
.eag-terms-label { align-items: flex-start; }
.eag-terms-label .eag-checkmark { margin-top: 3px; }

/* ── Plain hyperlink-style text — strip ALL button appearance ── */
.eag-text-link,
.eag-text-link:link,
.eag-text-link:visited,
.eag-text-link:hover,
.eag-text-link:active,
.eag-text-link:focus {
    /* Reset every possible button style */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    /* Make it look like a link */
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #003AA5;
    cursor: pointer;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}
.eag-text-link:hover { opacity: 0.7 !important; }
/* Override any global button styles from the theme */
.eag-auth-wrap button.eag-text-link,
.eag-auth-card button.eag-text-link {
    all: unset;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #003AA5;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    display: inline;
    transition: opacity 0.2s;
}
.eag-auth-wrap button.eag-text-link:hover,
.eag-auth-card button.eag-text-link:hover { opacity: 0.7; }

.eag-auth-link {
    color: #003AA5;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: opacity 0.2s;
}
.eag-auth-link:hover { opacity: 0.7; }

/* ── Divider — plain sentence with embedded links ─────────── */
.eag-divider {
    text-align: center;
    font-size: 14px;
    color: var(--e-global-color-text, #374151);
    margin-top: 4px;
    line-height: 1.6;
}

/* ── Forgot note ──────────────────────────────────────────── */
.eag-forgot-note {
    font-size: 14px;
    color: var(--e-global-color-text, #374151);
    line-height: 1.6;
}

/* ── Primary button ───────────────────────────────────────── */
.eag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s,
                transform 0.15s, box-shadow 0.2s;
    width: 100%;
    text-decoration: none;
    margin-top: 4px;
}
.eag-btn:active { transform: scale(0.985); }

.eag-btn-primary {
    background-color: #003AA5;
    color: #ffffff;
    border-color: #003AA5;
    box-shadow: 0 4px 16px rgba(0,58,165,0.25);
}
.eag-btn-primary:hover {
    background-color: #002d82;
    border-color: #002d82;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0,58,165,0.35);
}
.eag-btn-primary:disabled,
.eag-btn-primary.eag-loading { opacity:0.65; cursor:not-allowed; transform:none; }

.eag-btn-outline {
    background: transparent; color: #003AA5; border-color: #003AA5;
}
.eag-btn-outline:hover { background: #003AA5; color: #fff; }

/* ── Spinner ──────────────────────────────────────────────── */
.eag-spin { animation: eag-spin 0.8s linear infinite; }
@keyframes eag-spin { from{transform:rotate(0deg);} to{transform:rotate(360deg);} }

/* ── Logged-in state ──────────────────────────────────────── */
.eag-welcome { font-size:16px; color:var(--e-global-color-text,#374151); margin-bottom:20px; }
.eag-welcome strong { color:#003AA5; }
.eag-logged-btns { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.eag-logged-btns .eag-btn { width:auto; min-width:140px; }
