/**
 * EBA Auth Widgets — Login & Register
 * Split layout matching the reference screenshots exactly.
 */

.eba-wrapper.eba-auth {
    min-height: 600px;
    background: var(--eba-ivory);
}

.eba-auth--full-height { min-height: 100vh; }

.eba-auth__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: inherit;
}

.eba-auth--form-right .eba-auth__inner {
    grid-template-areas: 'visual form';
}
.eba-auth--form-right .eba-auth__form-side { grid-area: form; }
.eba-auth--form-right .eba-auth__visual-side { grid-area: visual; }

.eba-auth--form-left .eba-auth__inner {
    grid-template-areas: 'form visual';
}
.eba-auth--form-left .eba-auth__form-side { grid-area: form; }
.eba-auth--form-left .eba-auth__visual-side { grid-area: visual; }

/* ==========================================
   FORM SIDE
   ========================================== */
.eba-auth__form-side {
    background: var(--eba-ivory);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    position: relative;
}

.eba-auth__form-wrap {
    width: 100%;
    max-width: 440px;
    position: relative;
}

.eba-auth__logo {
    display: block;
    margin: 0 auto var(--eba-space-5);
    max-height: 72px;
    width: auto;
}

.eba-auth__ace {
    position: absolute;
    top: 0;
    right: 0;
    max-height: 48px;
    width: auto;
    background: #fff;
    padding: 6px 10px;
    border-radius: var(--eba-radius-sm);
    border: 1px solid var(--eba-border);
}

.eba-auth__form-header {
    margin-bottom: var(--eba-space-6);
}

.eba-auth__heading {
    font-family: var(--eba-font-heading) !important;
    font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem) !important;
    color: var(--eba-charcoal) !important;
    margin: 0 0 var(--eba-space-2) !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em;
}

.eba-auth__subheading {
    font-size: var(--eba-text-base) !important;
    color: var(--eba-text-muted) !important;
    margin: 0 !important;
    line-height: 1.5;
}

/* ==========================================
   FORM FIELDS
   ========================================== */
.eba-auth__form {
    display: flex;
    flex-direction: column;
    gap: var(--eba-space-4);
}

.eba-auth__form .eba-field {
    margin: 0;
    gap: 6px;
}

.eba-auth__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--eba-space-2);
}

.eba-auth__forgot {
    font-size: var(--eba-text-sm);
    color: var(--eba-gold-dark) !important;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--eba-duration-base) var(--eba-ease);
}

.eba-auth__forgot:hover { color: var(--eba-gold) !important; }

.eba-auth__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.eba-auth__input-icon {
    position: absolute;
    left: 16px;
    color: var(--eba-text-subtle);
    pointer-events: none;
    z-index: 1;
}

.eba-auth__input {
    padding-left: 46px !important;
    height: 48px;
    background: #ffffff !important;
    border-color: var(--eba-border) !important;
    font-size: 0.9375rem !important;
}

.eba-auth__input--no-icon {
    padding-left: 16px !important;
}

.eba-auth__eye {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--eba-text-subtle) !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--eba-radius-sm) !important;
    transition: all var(--eba-duration-base) var(--eba-ease);
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
}

.eba-auth__eye:hover {
    color: var(--eba-gold-dark) !important;
    background: var(--eba-ivory-dark) !important;
}

.eba-auth__eye:focus {
    outline: none !important;
    color: var(--eba-gold-dark) !important;
    background: var(--eba-ivory-dark) !important;
}

.eba-auth__eye:focus-visible {
    outline: 2px solid var(--eba-gold) !important;
    outline-offset: 2px !important;
}

.eba-auth__eye svg {
    width: 18px !important;
    height: 18px !important;
    color: currentColor !important;
    stroke: currentColor !important;
    fill: none !important;
    display: block !important;
}

/* Two icons inside: show/hide (specificity must beat .eba-auth__eye svg) */
.eba-auth__eye svg.eba-auth__eye-off { display: none !important; }
.eba-auth__eye svg.eba-auth__eye-on  { display: block !important; }
.eba-auth__eye[data-visible="true"] svg.eba-auth__eye-on  { display: none !important; }
.eba-auth__eye[data-visible="true"] svg.eba-auth__eye-off { display: block !important; }

/* Make room for the eye button inside password inputs */
.eba-auth__input-wrap input[type="password"],
.eba-auth__input-wrap input[type="text"]:not(.eba-auth__input--no-icon) {
    padding-right: 48px !important;
}

/* Password strength meter */
.eba-auth__strength {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--eba-text-muted);
}

.eba-auth__strength-bar {
    flex: 1;
    height: 4px;
    background: var(--eba-ivory-dark);
    border-radius: var(--eba-radius-full);
    transition: background 0.2s var(--eba-ease);
}

.eba-auth__strength-text {
    flex: 0 0 auto;
    margin-left: 8px;
    font-weight: 500;
    min-width: 56px;
    text-align: right;
}

.eba-auth__strength[data-score="1"] .eba-auth__strength-bar:nth-child(1) { background: #dc2626; }
.eba-auth__strength[data-score="1"] .eba-auth__strength-text { color: #dc2626; }

.eba-auth__strength[data-score="2"] .eba-auth__strength-bar:nth-child(-n+2) { background: #f59e0b; }
.eba-auth__strength[data-score="2"] .eba-auth__strength-text { color: #f59e0b; }

.eba-auth__strength[data-score="3"] .eba-auth__strength-bar:nth-child(-n+3) { background: #d4a24c; }
.eba-auth__strength[data-score="3"] .eba-auth__strength-text { color: var(--eba-gold-dark); }

.eba-auth__strength[data-score="4"] .eba-auth__strength-bar { background: #16a34a; }
.eba-auth__strength[data-score="4"] .eba-auth__strength-text { color: #16a34a; }

/* Remember me + checkbox rows */
.eba-auth__remember,
.eba-auth__check-row {
    display: flex;
    align-items: flex-start;
    gap: var(--eba-space-2);
    cursor: pointer;
    font-size: var(--eba-text-sm);
    color: var(--eba-text-muted);
    user-select: none;
    line-height: 1.5;
}

.eba-auth__remember input,
.eba-auth__check-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.eba-auth__check {
    width: 20px;
    height: 20px;
    border-radius: var(--eba-radius-full);
    border: 2px solid var(--eba-gold);
    flex-shrink: 0;
    position: relative;
    transition: all var(--eba-duration-base) var(--eba-ease);
    margin-top: 1px;
}

.eba-auth__terms .eba-auth__check,
.eba-auth__remember .eba-auth__check {
    border-radius: var(--eba-radius-full);
}

.eba-auth__remember input:checked ~ .eba-auth__check,
.eba-auth__check-row input:checked ~ .eba-auth__check {
    background: var(--eba-gradient-gold);
    border-color: var(--eba-gold-dark);
}

.eba-auth__remember input:checked ~ .eba-auth__check::after,
.eba-auth__check-row input:checked ~ .eba-auth__check::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}

.eba-auth__remember-text,
.eba-auth__check-text {
    line-height: 1.5;
}

.eba-auth__inline-link {
    color: var(--eba-gold-dark) !important;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--eba-duration-base) var(--eba-ease);
}

.eba-auth__inline-link:hover { color: var(--eba-gold) !important; text-decoration: underline; }

/* Submit button */
.eba-auth__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eba-space-2);
    width: 100%;
    height: 52px;
    padding: 0 var(--eba-space-5);
    border: 0;
    border-radius: var(--eba-radius-md);
    background: var(--eba-gradient-gold);
    color: #ffffff !important;
    font-family: var(--eba-font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--eba-duration-base) var(--eba-ease);
    box-shadow: var(--eba-shadow-gold);
    margin-top: var(--eba-space-2);
    letter-spacing: 0.01em;
}

.eba-auth__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -8px rgba(212, 162, 76, 0.5);
}

.eba-auth__submit:active { transform: translateY(0); }

.eba-auth__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.eba-auth__submit.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.eba-auth__submit.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: var(--eba-radius-full);
    animation: eba-auth-spin 0.7s linear infinite;
}

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

/* Message area */
.eba-auth__message {
    padding: var(--eba-space-3) var(--eba-space-4);
    border-radius: var(--eba-radius-md);
    font-size: var(--eba-text-sm);
    line-height: 1.5;
    animation: eba-fade-up 0.3s var(--eba-ease-out);
}

.eba-auth__message.is-error {
    background: #fee2e2;
    color: #7f1d1d;
    border-left: 3px solid var(--eba-error);
}

.eba-auth__message.is-success {
    background: #dcfce7;
    color: #14532d;
    border-left: 3px solid var(--eba-success);
}

/* Name row (register) */
.eba-auth__names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--eba-space-3);
}

/* Social login */
.eba-auth__social-sep {
    position: relative;
    text-align: center;
    margin: var(--eba-space-5) 0 var(--eba-space-4);
}

.eba-auth__social-sep::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--eba-border);
    z-index: 0;
}

.eba-auth__social-sep span {
    position: relative;
    z-index: 1;
    background: var(--eba-ivory);
    padding: 0 var(--eba-space-3);
    font-size: var(--eba-text-xs);
    color: var(--eba-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.eba-auth__social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--eba-space-2);
}

.eba-auth__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eba-space-2);
    height: 48px;
    padding: 0 var(--eba-space-4);
    border: 1.5px solid var(--eba-gold) !important;
    border-radius: var(--eba-radius-md);
    background: transparent;
    color: var(--eba-gold-dark) !important;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--eba-duration-base) var(--eba-ease);
    opacity: 0.85;
}

.eba-auth__social-btn:hover {
    opacity: 1;
    background: var(--eba-gold-soft);
    transform: translateY(-1px);
}

.eba-auth__social-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto;
}
.eba-auth__social-btn.is-disabled:hover {
    background: transparent;
    transform: none;
}

/* Switch link (register/login cross-link) */
.eba-auth__switch {
    margin-top: var(--eba-space-6);
    text-align: center;
    font-size: var(--eba-text-sm);
    color: var(--eba-text-muted);
}

.eba-auth__switch a {
    color: var(--eba-gold-dark) !important;
    font-weight: 500;
    text-decoration: none;
    margin-left: 4px;
}

.eba-auth__switch a:hover { color: var(--eba-gold) !important; text-decoration: underline; }

/* ==========================================
   VISUAL SIDE
   ========================================== */
.eba-auth__visual-side {
    background-size: cover;
    background-position: center;
    background-color: var(--eba-charcoal);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    min-height: 400px;
    overflow: hidden;
    isolation: isolate;
}

.eba-auth__visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.65) 100%);
    pointer-events: none;
    z-index: 0;
}

.eba-auth--register .eba-auth__visual-overlay {
    background: linear-gradient(135deg, rgba(181, 136, 52, 0.75) 0%, rgba(212, 162, 76, 0.4) 100%);
}

.eba-auth__visual-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    width: 100%;
    color: #ffffff;
    text-align: center !important;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eba-auth__visual-content > * {
    text-align: center !important;
    width: 100%;
}

.eba-auth__features {
    text-align: left !important;
    max-width: 340px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.eba-auth__visual-heading {
    font-family: var(--eba-font-heading) !important;
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem) !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    margin: 0 0 var(--eba-space-4) !important;
    letter-spacing: -0.01em;
    text-align: center !important;
    width: 100%;
}

.eba-auth__accent {
    color: var(--eba-gold-light) !important;
    font-style: italic;
    font-weight: 400;
}

.eba-auth__visual-description {
    font-size: clamp(0.9375rem, 1vw + 0.25rem, 1.0625rem) !important;
    line-height: 1.65 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    text-align: center !important;
    width: 100%;
}

.eba-auth__features {
    list-style: none;
    padding: 0;
    margin: var(--eba-space-5) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--eba-space-3);
}

.eba-auth__features li {
    display: flex;
    align-items: center;
    gap: var(--eba-space-3);
    color: #ffffff;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.eba-auth__features svg {
    color: var(--eba-gold-light);
    flex-shrink: 0;
}

/* ==========================================
   RESPONSIVE — single column on tablet & below
   ========================================== */
@media (max-width: 960px) {
    .eba-wrapper.eba-auth,
    .eba-auth--full-height {
        min-height: auto !important;
    }

    .eba-auth__inner {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        grid-template-areas: none !important;
    }

    .eba-auth__visual-side,
    .eba-auth__form-side {
        grid-area: auto !important;
        width: 100%;
    }

    .eba-auth__visual-side {
        min-height: 220px;
        order: 1;
    }

    .eba-auth__form-side {
        order: 2;
        padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2rem);
    }

    .eba-auth__visual-content {
        text-align: center;
    }

    .eba-auth__features {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .eba-auth__ace { top: 16px; right: 16px; max-height: 40px; }
    .eba-auth__logo { max-height: 56px; margin-bottom: var(--eba-space-4); margin-left: auto; margin-right: auto; }
    .eba-auth__heading { font-size: clamp(1.5rem, 5vw, 2rem) !important; }

    /* Center form heading + subheading on mobile (both login + register) */
    .eba-auth__form-header {
        text-align: center !important;
    }
    .eba-auth__form-header .eba-auth__heading,
    .eba-auth__form-header .eba-auth__subheading {
        text-align: center !important;
    }

    /* Center the "Or continue with" + social + switch link */
    .eba-auth__switch {
        text-align: center !important;
    }
}

/* Hide visual side on mobile when opt-in */
@media (max-width: 960px) {
    .eba-auth.eba-auth--hide-visual-mobile .eba-auth__visual-side {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .eba-auth__visual-side {
        padding: 2rem 1.5rem;
        min-height: 180px;
    }
    .eba-auth__visual-heading {
        font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
        margin-bottom: var(--eba-space-2) !important;
    }
    .eba-auth__visual-description {
        font-size: 0.9375rem !important;
    }
    .eba-auth__features {
        margin-top: var(--eba-space-3);
    }
    .eba-auth__features li {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .eba-auth__names {
        grid-template-columns: 1fr;
    }
    .eba-auth__social {
        grid-template-columns: 1fr;
    }
    .eba-auth__form-side {
        padding: 1.5rem 1.25rem !important;
    }
    .eba-auth__form-wrap {
        max-width: 100%;
    }
}
