﻿/* ============================================================
   EduPack — Shared Auth Styles  (Responsive)
   Covers: Login, Register, Forgot Password, Reset Password,
           Email Verification / Success pages
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --up-maroon: #8A1538;
    --up-maroon-dark: #6B1029;
    --up-maroon-deep: #4e0b1e;
    --up-maroon-light: #f5e6eb;
    --up-maroon-pale: #fdf5f7;
    --up-gold: #FFCC33;
    --up-gold-dark: #e6b800;
    --up-green: #00573F;
    --up-green-light: #e6f2ee;
    --up-border: #ddd5d7;
    --up-muted: #6b6b6b;
    --up-ink: #1a1a1a;
    --font-serif: 'EB Garamond', Georgia, serif;
    --font-sans: 'Source Sans 3', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Body & background ─────────────────────────────────────── */
* {
    /* Prevents padding from adding to the total width/height */
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(ellipse at 75% 15%, rgba(255,204,51,.09) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 80%, rgba(0,87,63,.12) 0%, transparent 50%),
        linear-gradient(145deg, var(--up-maroon-deep) 0%, var(--up-maroon) 50%, #6b1229 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

    /* Grid overlay */
    body::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background-image: linear-gradient(rgba(255,204,51,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,204,51,.055) 1px, transparent 1px);
        background-size: 44px 44px;
        z-index: 0;
    }

    /* Decorative circle accents */
    body::after {
        content: '';
        position: absolute;
        bottom: -140px;
        right: -100px;
        width: 480px;
        height: 480px;
        border-radius: 50%;
        border: 1.5px solid rgba(255, 204, 51, .10);
        box-shadow: inset 0 0 80px rgba(255, 204, 51, .03);
        pointer-events: none;
        z-index: 0;
    }

/* ── Page wrappers ─────────────────────────────────────────── */

/* Narrow pages: Login, Forgot Password, Reset Password, Verify */
.auth-wrap,
.login-wrap {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: fadeUp .45s ease both;
}

/* Register page (wider) */
.register-wrap {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── Card ──────────────────────────────────────────────────── */
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, .42),
        0 8px 24px rgba(0, 0, 0, .18),
        0 0 0 1px rgba(255, 204, 51, .12);
    border-top: 4px solid var(--up-gold);
    overflow: hidden;
}
.reg-card {
    border-radius: 16px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, .42),
        0 8px 24px rgba(0, 0, 0, .18),
        0 0 0 1px rgba(255, 204, 51, .12);
    border-top: 4px solid var(--up-gold);
    overflow: hidden;
}
/* ── Card header ───────────────────────────────────────────── */
.auth-header {
    background: linear-gradient(135deg, var(--up-maroon-deep) 0%, var(--up-maroon) 100%);
    padding: 1.75rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,204,51,.18);
}

.auth-logo-box {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, #ffe566 0%, #FFCC33 45%, #c98f00 100%);
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .7rem;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.55),
        inset 0 -1px 2px rgba(0, 0, 0, 0.15),
        0 6px 18px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

    .auth-logo-box::after {
        content: '';
        position: absolute;
        top: -60%;
        left: -80%;
        width: 55%;
        height: 220%;
        background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.38) 50%, transparent 100%);
        transform: skewX(-15deg);
        pointer-events: none;
    }

.auth-brand {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

    .auth-brand span {
        color: var(--up-gold);
    }

.auth-tagline {
    font-size: .72rem;
    color: rgba(255,255,255,.60);
    letter-spacing: .09em;
    text-transform: uppercase;
    margin-top: .3rem;
    font-family: var(--font-sans);
}

/* ── Card body ─────────────────────────────────────────────── */
.auth-body {
    padding: 1.75rem 2rem 2rem;
}

.auth-subtitle {
    font-size: .9rem;
    color: var(--up-muted);
    text-align: center;
    margin-bottom: 1.4rem;
    font-family: var(--font-sans);
}

/* Icon circle (Forgot / Reset / Verify pages) */
.auth-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--up-maroon-pale);
    border: 2px solid var(--up-maroon-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--up-maroon);
    margin: 0 auto 1rem;
}

/* Success circle (Verify page) */
.success-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--up-green-light);
    border: 2px solid #a8d4c5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--up-green);
    margin: 0 auto 1rem;
}

/* Email chip (Verify page) */
.email-chip {
    display: inline-block;
    background: var(--up-maroon-pale);
    border: 1px solid var(--up-maroon-light);
    border-radius: 20px;
    padding: .3rem 1rem;
    font-weight: 600;
    font-size: .9rem;
    word-break: break-all;
    color: var(--up-maroon);
    margin-bottom: 1rem;
    max-width: 100%;
}

/* ── Input groups ──────────────────────────────────────────── */
.ig-wrap {
    display: flex;
    margin-bottom: .1rem;
}

    .ig-wrap .form-floating {
        flex: 1;
        min-width: 0;
    }

        .ig-wrap .form-floating .form-control {
            border-right: 0;
            border-radius: .375rem 0 0 .375rem;
            font-family: var(--font-sans);
        }

            .ig-wrap .form-floating .form-control:focus {
                border-color: var(--up-maroon);
                box-shadow: none;
            }

    .ig-wrap .igt {
        border-left: 0;
        background: transparent;
        color: var(--up-muted);
        border-radius: 0 .375rem .375rem 0;
        transition: color .15s, border-color .15s;
        cursor: pointer;
        /* Ensure touch-friendly tap target */
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ig-wrap:focus-within .igt {
        color: var(--up-maroon);
        border-color: var(--up-maroon);
    }

.mb-field {
    margin-bottom: 1rem;
}

.form-floating label {
    font-size: .85rem;
    color: var(--up-muted);
    font-family: var(--font-sans);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-up {
    background: var(--up-maroon);
    border: none;
    border-bottom: 3px solid var(--up-maroon-dark);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: .02em;
    padding: .55rem 1rem;
    border-radius: 7px;
    transition: background .15s;
    width: 100%;
    /* Touch-friendly minimum height */
    min-height: 44px;
}

    .btn-up:hover,
    .btn-up:focus {
        background: var(--up-maroon-dark);
        color: #fff;
    }

    .btn-up:focus {
        box-shadow: 0 0 0 3px rgba(138,21,56,.25);
    }

.btn-up-outline {
    background: transparent;
    border: 2px solid var(--up-maroon);
    color: var(--up-maroon);
    font-family: var(--font-sans);
    font-weight: 600;
    padding: .45rem 1.25rem;
    border-radius: 7px;
    transition: background .15s, color .15s;
    font-size: .85rem;
    min-height: 44px;
}

    .btn-up-outline:hover,
    .btn-up-outline:focus {
        background: var(--up-maroon);
        color: #fff;
    }

/* ── Checkbox ──────────────────────────────────────────────── */
.form-check-input:checked {
    background-color: var(--up-maroon);
    border-color: var(--up-maroon);
}

/* Touch-friendly checkbox area */
.form-check {
    min-height: 1.75rem;
}

.form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: .2em;
}

/* ── Forgot password link ──────────────────────────────────── */
a.forgot {
    color: var(--up-maroon);
    font-size: .8rem;
    text-decoration: none;
    /* Touch target */
    padding: .25rem 0;
    display: inline-block;
}

    a.forgot:hover {
        text-decoration: underline;
    }

/* ── Divider (Login page) ──────────────────────────────────── */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.1rem 0;
    color: var(--up-muted);
    font-size: .78rem;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 44%;
        height: 1px;
        background: var(--up-border);
    }

    .auth-divider::before {
        left: 0;
    }

    .auth-divider::after {
        right: 0;
    }

/* ── Password strength bar ─────────────────────────────────── */
.pw-strength-bar {
    height: 4px;
    border-radius: 2px;
    transition: width .3s, background .3s;
    width: 0;
}

/* ── Footer links ──────────────────────────────────────────── */
.auth-foot {
    text-align: center;
    font-size: .82rem;
    color: var(--up-muted);
    margin-top: .9rem;
}

    .auth-foot a {
        color: var(--up-maroon);
        font-weight: 600;
        text-decoration: none;
        padding: .25rem 0;
        display: inline-block;
    }

        .auth-foot a:hover {
            text-decoration: underline;
        }

/* Sign-in footer on Register page (dark background, gold link) */
.signin-foot {
    text-align: center;
    font-size: .88rem;
    margin-top: .75rem;
    padding: .7rem 1.25rem;
    background: rgba(0,0,0,.25);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.85);
}

    .signin-foot a {
        color: var(--up-gold);
        font-weight: 700;
        text-decoration: none;
    }

        .signin-foot a:hover {
            text-decoration: underline;
        }

/* ── Register page — Bootstrap/AdminLTE overrides ──────────── */
.container-fluid {
    position: relative;
    z-index: 1;
}

.reg-brand-text {
    font-family: var(--font-serif) !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: #fff !important;
}

    .reg-brand-text span {
        color: var(--up-gold) !important;
    }

.text-muted.small {
    color: rgba(255,255,255,.65) !important;
}

.nav-pills .nav-link {
    font-family: var(--font-sans);
    font-size: .82rem;
    color: rgba(255,255,255,.7) !important;
    background: rgba(255,255,255,.10) !important;
    /* Touch-friendly */
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .nav-pills .nav-link.active {
        background: var(--up-gold) !important;
        color: var(--up-maroon-deep) !important;
        font-weight: 700;
    }

    .nav-pills .nav-link.disabled {
        color: rgba(255,255,255,.3) !important;
        background: rgba(255,255,255,.05) !important;
    }

.bg-white.rounded.shadow-sm {
    background: rgba(255,255,255,.12) !important;
    backdrop-filter: blur(4px);
}

.card {
    border-radius: 12px !important;
    border: none !important;
    border-top: 4px solid var(--up-gold) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.28) !important;
}

.card-outline.card-primary {
    border-top: 4px solid var(--up-gold) !important;
}

.text-uppercase.text-muted.fw-bold.small.border-bottom {
    color: var(--up-maroon) !important;
    border-bottom-color: var(--up-maroon-light) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--up-maroon) !important;
    box-shadow: 0 0 0 .2rem rgba(138,21,56,.15) !important;
}

.btn-primary {
    background: var(--up-maroon) !important;
    border-color: var(--up-maroon) !important;
    border-bottom: 3px solid var(--up-maroon-dark) !important;
    font-weight: 600 !important;
    min-height: 38px;
}

    .btn-primary:hover {
        background: var(--up-maroon-dark) !important;
        border-color: var(--up-maroon-dark) !important;
    }

.card-footer.bg-body-tertiary {
    background: var(--up-maroon-pale) !important;
}

.bi-cloud-arrow-up {
    color: var(--up-maroon) !important;
}

#avatarDropZone {
    border-color: var(--up-maroon-light) !important;
}

    #avatarDropZone:hover {
        border-color: var(--up-maroon) !important;
        background: var(--up-maroon-pale) !important;
    }

/* ── Animation ─────────────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet: ≤768px ────────────────────────────────────────── */
@media (max-width: 768px) {

    body {
        padding: 1.25rem .75rem;
        align-items: flex-start;
    }

        /* Hide decorative circle on tablet/mobile to reduce clutter */
        body::after {
            display: none;
        }

    /* Narrow auth pages fill viewport width */
    .auth-wrap,
    .login-wrap {
        max-width: 100%;
    }

    .auth-header {
        padding: 1.4rem 1.5rem 1.2rem;
    }

    .auth-brand {
        font-size: 1.55rem;
    }

    .auth-body {
        padding: 1.4rem 1.5rem 1.75rem;
    }

    /* Register page max-width relaxation handled by container */
    .container-fluid > .w-100 {
        max-width: 100% !important;
    }

    /* Step tab text wraps gracefully */
    .nav-pills .nav-link {
        font-size: .78rem;
        padding: .45rem .5rem;
    }

    /* Card footer stack on narrow tablet */
    .card-footer.d-flex {
        flex-wrap: wrap;
        gap: .5rem;
    }
}

/* ── Mobile: ≤575px ────────────────────────────────────────── */
@media (max-width: 575px) {

    body {
        padding: 1rem .5rem;
        background-attachment: local; /* Avoids iOS scroll jank */
    }

    /* Narrow cards edge-to-edge with slight margin */
    .auth-wrap,
    .login-wrap {
        max-width: 100%;
        padding: 0 .25rem;
    }

    .auth-card {
        border-radius: 10px;
        box-shadow: 0 12px 40px rgba(0,0,0,.28);
    }

    .auth-header {
        padding: 1.2rem 1.25rem 1rem;
    }

    .auth-logo-box {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .auth-brand {
        font-size: 1.4rem;
    }

    .auth-tagline {
        font-size: .65rem;
        letter-spacing: .06em;
    }

    .auth-body {
        padding: 1.25rem 1.1rem 1.5rem;
    }

    /* "Remember me / Forgot password" row stacks vertically */
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: .5rem;
    }

    /* Forgot password takes full width for easier tapping */
    a.forgot {
        font-size: .85rem;
    }

    /* Auth-footer gets more breathing room */
    .auth-foot {
        margin-top: 1.2rem;
        font-size: .85rem;
    }

    /* Email chip wraps properly */
    .email-chip {
        font-size: .82rem;
        padding: .25rem .75rem;
    }

    /* Icon circles slightly smaller */
    .auth-icon-circle {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    .success-circle {
        width: 62px;
        height: 62px;
        font-size: 1.55rem;
    }

    /* Register page */
    .reg-brand-text {
        font-size: 1.5rem !important;
    }

    .signin-foot {
        font-size: .82rem;
        padding: .6rem 1rem;
    }

    /* Nav pills — shorter text on very small screens */
    .nav-pills .nav-link {
        font-size: .75rem;
        min-height: 44px;
    }

    /* Avatar dropzone stacks icon & text better */
    #avatarDropZone {
        min-height: 80px;
    }

    /* Card body padding tighter */
    .card-body {
        padding: 1rem !important;
    }

    .card-footer {
        padding: .75rem 1rem !important;
    }

        /* Step footer buttons full-width on mobile */
        .card-footer.d-flex {
            flex-direction: column-reverse;
            align-items: stretch !important;
        }

        .card-footer .btn {
            width: 100%;
            min-width: 150px;
            justify-content: center;
        }
}

/* ── Very small phones: ≤360px ─────────────────────────────── */
@media (max-width: 360px) {

    .auth-header {
        padding: 1rem;
    }

    .auth-body {
        padding: 1rem .9rem 1.25rem;
    }

    .auth-brand {
        font-size: 1.25rem;
    }

    .auth-tagline {
        display: none;
    }
    /* Too cramped — hide */

    .ig-wrap .igt {
        min-width: 38px;
    }
}

/* ── Landscape phones: short viewport ──────────────────────── */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: .75rem 1rem;
        align-items: flex-start;
    }

    .auth-header {
        padding: .9rem 1.5rem .75rem;
        display: flex;
        align-items: center;
        gap: .75rem;
        text-align: left;
    }

    .auth-logo-box {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .auth-brand {
        font-size: 1.35rem;
    }

    .auth-tagline {
        margin-top: .15rem;
        font-size: .62rem;
    }

    .auth-body {
        padding: 1rem 1.5rem 1.25rem;
    }

    .auth-icon-circle,
    .success-circle {
        margin-bottom: .5rem;
    }
}

/* ── Site Navigation Links (below auth cards) ── */
.auth-site-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 1.1rem;
    padding: 0.55rem 1.25rem;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50px;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
}

    .auth-site-links a {
        color: rgba(255, 255, 255, 0.52);
        text-decoration: none;
        padding: 0.15rem 0.55rem;
        border-radius: 4px;
        transition: color 0.18s, background 0.18s;
        white-space: nowrap;
    }

    .auth-site-links a:hover {
        color: var(--up-gold);
        background: rgba(255, 204, 51, 0.10);
        text-decoration: none;
    }

    .auth-site-links a i {
        font-size: 0.68rem;
        opacity: 0.85;
    }

.auth-site-sep {
    color: rgba(255, 255, 255, 0.18);
    font-size: 0.62rem;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}
