/* =========================================================
   Web Lynix Orbit — Auth Pages (Login & Register)
   ========================================================= */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Back Home Link ---------- */
.back-home {
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 5vw;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: color 0.3s var(--ease);
    align-self: flex-start;
}

.back-home:hover {
    color: var(--color-white);
}

.back-home svg {
    transition: transform 0.3s var(--ease);
}

.back-home:hover svg {
    transform: translateX(-4px);
}

/* ---------- Auth Wrapper ---------- */
.auth-wrapper {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 5vw 60px;
}

/* ---------- Auth Card ---------- */
.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    animation: cardEnter 0.8s var(--ease-spring) both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Logo ---------- */
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--color-white);
    animation: fadeUp 0.6s var(--ease) 0.2s both;
}

.auth-logo svg {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.35));
    animation: orbitSpin 12s linear infinite;
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Auth Titles ---------- */
.auth-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    animation: fadeUp 0.6s var(--ease) 0.3s both;
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    animation: fadeUp 0.6s var(--ease) 0.4s both;
}

/* ---------- Form ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeUp 0.6s var(--ease) 0.5s both;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---------- Input Wrapper ---------- */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--color-text-faint);
    pointer-events: none;
    transition: color 0.3s var(--ease);
}

.input-wrap input {
    width: 100%;
    padding: 14px 40px 14px 46px; /* ADDED 40px RIGHT PADDING FOR EYE BUTTON */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: all 0.3s var(--ease);
    outline: none;
}

.input-wrap input::placeholder {
    color: var(--color-text-faint);
}

.input-wrap input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.input-wrap input:focus + .input-icon,
.input-wrap:has(input:focus) .input-icon {
    color: var(--color-white);
}

/* Invalid state */
.input-wrap input.invalid {
    border-color: var(--color-error);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.08);
}

/* Valid state */
.input-wrap input.valid {
    border-color: rgba(74, 222, 128, 0.4);
}

/* ---------- Password Toggle ---------- */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-faint);
    border-radius: 8px;
    transition: all 0.3s var(--ease);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2; /* FORCES BUTTON ABOVE INPUT */
}

.toggle-password:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.06);
}

/* ---------- Error Text ---------- */
.error-text {
    font-size: 0.8rem;
    color: var(--color-error);
    min-height: 16px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s var(--ease);
}

.error-text.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Form Row (Remember + Forgot) ---------- */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Custom Checkbox ---------- */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    user-select: none;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    position: relative;
    transition: all 0.25s var(--ease);
}

.checkbox input:checked + .checkmark {
    background: var(--color-white);
    border-color: var(--color-white);
}

.checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid var(--color-black);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox input:focus-visible + .checkmark {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* ---------- Links ---------- */
.link-muted {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    transition: color 0.3s var(--ease);
}

.link-muted:hover {
    color: var(--color-white);
}

/* ---------- Alert Banners ---------- */
.alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.5;
    animation: fadeUp 0.4s var(--ease) both;
}

.alert.show {
    display: block;
}

.alert-error {
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: #ff9b9b;
}

.alert-success {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #86efac;
}

/* ---------- Auth Footer ---------- */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--color-white);
    font-weight: 500;
    position: relative;
    transition: color 0.3s var(--ease);
}

.auth-footer a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--color-white);
    transition: width 0.3s var(--ease);
}

.auth-footer a:hover::after {
    width: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .auth-card {
        padding: 36px 24px;
    }

    .auth-title {
        font-size: 1.55rem;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}