/* ═══════════════════════════════════════════════════════════
   DayReady — Auth Pages
   Login, Sub Access Code, Role Selection
   ═══════════════════════════════════════════════════════════ */

/* ─── Wrapper ──────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/auth-bg.avif') center center / cover no-repeat;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}


/* ─── Animated Background Shapes ───────────────────────────── */
.auth-shapes {
    display: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: white;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -120px;
    right: -80px;
    animation: float1 18s ease-in-out infinite;
}

.shape-2 {
    width: 250px;
    height: 250px;
    bottom: -60px;
    left: -40px;
    background: var(--accent);
    opacity: 0.12;
    animation: float2 22s ease-in-out infinite;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 15%;
    animation: float3 15s ease-in-out infinite;
}

.shape-4 {
    width: 80px;
    height: 80px;
    top: 25%;
    right: 20%;
    background: var(--accent);
    opacity: 0.1;
    animation: float1 20s ease-in-out infinite reverse;
}

.shape-5 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    right: 10%;
    animation: float2 16s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -40px) scale(1.05); }
    66%      { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(-30px, -30px) rotate(180deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(20px, -20px); }
    50%      { transform: translate(-10px, -35px); }
    75%      { transform: translate(-25px, 10px); }
}

/* ─── Noise Texture ────────────────────────────────────────── */
.auth-noise {
    display: none;
}

/* ─── Container ────────────────────────────────────────────── */
.auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
}

/* ─── Auth Card ────────────────────────────────────────────── */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: scaleIn 0.5s var(--ease) both;
}

/* ─── Logo & Branding ──────────────────────────────────────── */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, var(--accent) 100%);
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.auth-logo .logo-mark i {
    font-size: 2rem;
    color: white;
}

.auth-logo .logo-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.auth-logo .logo-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Auth Form ────────────────────────────────────────────── */
.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-form .input-icon-wrapper {
    position: relative;
}

.auth-form .input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    color: var(--text-light);
    transition: color var(--duration-fast) var(--ease);
}

.auth-form .input-icon-wrapper input {
    padding-left: 2.75rem;
}

.auth-form .input-icon-wrapper:focus-within i {
    color: var(--primary);
}

.auth-form .form-control {
    padding: 0.8125rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.auth-form .btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-form .btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.auth-form .btn-login.loading .btn-text { opacity: 0; }
.auth-form .btn-login.loading .spinner { display: block; position: absolute; }

/* ─── Access Code Input ────────────────────────────────────── */
.access-code-group {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.access-code-group .code-digit {
    width: 52px;
    height: 60px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: all var(--duration-fast) var(--ease);
    outline: none;
    caret-color: var(--primary);
}

.access-code-group .code-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.access-code-group .code-digit.filled {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

/* ─── Divider ──────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Links ────────────────────────────────────────────────── */
.auth-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
}

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

/* ─── Role Cards (Select Role) ─────────────────────────────── */
.auth-container.wide {
    max-width: 520px;
}

.role-cards {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 1.5rem;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    color: var(--text-body);
    background: var(--bg-card);
}

.role-card:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--text-body);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.role-card .role-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-card .role-icon i {
    font-size: 1.5rem;
    color: white;
}

.role-card .role-icon.sub     { background: linear-gradient(135deg, var(--accent), #F0A860); }
.role-card .role-icon.teacher { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.role-card .role-icon.admin   { background: linear-gradient(135deg, var(--success), #45B978); }

.role-card .role-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.role-card .role-info p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.role-card .role-arrow {
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--text-light);
    transition: transform var(--duration-fast) var(--ease);
}

.role-card:hover .role-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* ─── Footer ───────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.7);
}

/* ─── Touch States ─────────────────────────────────────────── */
.role-card:active {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateX(2px);
}

.btn-login:active {
    transform: scale(0.98);
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
    }

    .auth-logo img {
        height: 56px;
    }

    .access-code-group {
        gap: 0.4375rem;
    }

    .access-code-group .code-digit {
        width: 44px;
        height: 52px;
        font-size: 1.25rem;
    }

    .auth-logo .logo-title {
        font-size: 1.375rem;
    }

    .auth-logo .logo-tagline {
        font-size: 0.8125rem;
    }

    .role-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .role-card .role-icon {
        width: 42px;
        height: 42px;
    }

    .role-card .role-info h4 {
        font-size: 0.9375rem;
    }

    .auth-form .form-control {
        font-size: 1rem; /* Prevent iOS zoom */
    }

    .btn-login {
        min-height: 48px;
    }
}

@media (max-width: 375px) {
    .access-code-group {
        gap: 0.3125rem;
    }

    .access-code-group .code-digit {
        width: 40px;
        height: 48px;
        font-size: 1.125rem;
    }
}
