/* =========================================
   Auth Pages (login / register)
   ========================================= */

.auth-body {
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* subtle ambient glow on auth pages */
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(168, 85, 247, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 64px;
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .auth-main { padding: 160px 48px 80px; }
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(20, 22, 28, 0.7);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(34, 211, 238, 0.04);
    color: var(--text-primary);
    text-align: center;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(180deg,
        rgba(34, 211, 238, 0.18) 0%,
        transparent 35%,
        transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.auth-card__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authIconIn .6s var(--ease) both;
}

@keyframes authIconIn {
    from { opacity: 0; transform: scale(.7); }
    to   { opacity: 1; transform: scale(1); }
}

.auth-card__icon svg {
    width: 100%;
    height: 100%;
}

.auth-card__title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: .5px;
    animation: authTitleIn .6s var(--ease) .1s both;
}

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

.auth-card__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    animation: authTitleIn .6s var(--ease) .2s both;
}

/* =========================================
   Form
   ========================================= */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.auth-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form__label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding-left: 2px;
}

.auth-form__field {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.auth-form__field:hover {
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.auth-form__field:focus-within {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.06);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.auth-form__field.is-error {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.05);
}

.auth-form__field.is-error:focus-within {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.auth-form__field-icon {
    width: 40px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: color .2s var(--ease);
}

.auth-form__field:focus-within .auth-form__field-icon {
    color: var(--accent);
}

.auth-form__field-icon svg {
    width: 16px;
    height: 16px;
}

.auth-form__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px 14px 12px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    min-width: 0;
}

.auth-form__input::placeholder {
    color: var(--text-tertiary);
}

.auth-form__input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px rgba(20, 22, 28, 0.7) inset;
    caret-color: var(--text-primary);
}

.auth-form__submit {
    margin-top: 8px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 50%, #06b6d4 100%);
    color: #042f33;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
    box-shadow: 0 4px 14px rgba(34, 211, 238, 0.35);
    letter-spacing: .5px;
}

.auth-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.5);
    filter: brightness(1.05);
}

.auth-form__submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-form__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    filter: saturate(.7);
}

.auth-form__error {
    min-height: 18px;
    font-size: 13px;
    color: #fca5a5;
    text-align: center;
    margin-top: 4px;
}

.auth-form__error:empty { min-height: 0; }

.auth-form__alt {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.auth-form__alt-link {
    color: var(--accent);
    font-weight: 500;
    transition: color .2s var(--ease);
    margin-left: 4px;
}

.auth-form__alt-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* =========================================
   Auth-aware nav (login state toggling)
   ========================================= */
.nav__auth {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nav__auth[hidden] { display: none !important; }

.nav__auth-btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent);
    color: #042f33 !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: all .2s var(--ease);
    box-shadow: 0 2px 10px rgba(34, 211, 238, 0.25);
}

.nav__auth-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.4);
}

.nav__auth-btn.is-active {
    background: var(--accent-hover);
}

@media (max-width: 900px) {
    .nav__auth {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .nav__auth-btn {
        width: 100%;
        text-align: center;
    }
    .nav__auth[data-state="logged-in"] .nav__profile,
    .nav__auth[data-state="logged-in"] .nav__logout {
        flex: 1;
        justify-content: center;
    }
}

/* Optional form group (EHS PATCH) */
.auth-form__group--optional {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.auth-form__optional-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 400;
    margin-left: 6px;
}
.auth-form__hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin: 6px 0 0;
    line-height: 1.55;
}
