/* ============================================================
   DESK ANIMATIONS STUDIO — AUTH STYLES  (auth.css)
   Part 1 of 4

   Shared styles used by:
   • login.html      (Part 2)
   • register.html   (Part 2)
   • profile.html    (Part 3)
   • All pages       (avatar button — Part 4)

   Depends on: styles.css (must be loaded before auth.css)
   All colours match the main site palette.
   ============================================================ */

/* ── Auth page wrapper ───────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    background: #050816;
}

/* ── Ambient blobs behind the card ──────────────────────── */
.auth-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    animation: authBlobDrift 16s ease-in-out infinite alternate;
}
.auth-blob-1 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 70%);
    top: -100px; left: -150px;
    animation-delay: 0s;
}
.auth-blob-2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(124,58,237,.14) 0%, transparent 70%);
    bottom: -80px; right: -100px;
    animation-delay: -6s;
}
.auth-blob-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(56,189,248,.10) 0%, transparent 70%);
    top: 50%; left: 55%;
    animation-delay: -11s;
}
@keyframes authBlobDrift {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(30px, 25px) scale(1.06); }
}

/* ── Main auth card ──────────────────────────────────────── */
.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    background: rgba(11, 18, 38, 0.70);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 24px;
    padding: 48px 44px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 30px 80px rgba(0,0,0,.5);

    /* Entry animation */
    animation: authCardIn .65s cubic-bezier(.22,1,.36,1) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Top accent line */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #2563eb, #7c3aed, transparent);
    box-shadow: 0 0 16px rgba(59,130,246,.5);
}

/* ── Auth logo / brand ───────────────────────────────────── */
.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}
.auth-brand-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
    animation: iconBob 3s ease-in-out infinite;
}
@keyframes iconBob {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.auth-brand p {
    font-size: 0.88rem;
    color: #64748b;
}

/* ── Auth tab switcher (login ↔ register link) ───────────── */
.auth-tabs {
    display: flex;
    gap: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 9px 0;
    text-align: center;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: background .25s, color .25s, box-shadow .25s;
}
.auth-tab.active {
    background: rgba(37,99,235,.18);
    color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(59,130,246,.3);
}
.auth-tab:hover:not(.active) { color: #94a3b8; }

/* ── Form ────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.4px;
}

/* Input wrapper — holds icon + input */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
    opacity: .6;
    transition: opacity .25s;
}

.auth-input {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    padding: 12px 14px 12px 42px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
    caret-color: #60a5fa;
}
.auth-input::placeholder { color: #334155; }

.auth-input:focus {
    border-color: rgba(59,130,246,.55);
    background: rgba(37,99,235,.06);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    opacity: 1;
}

/* Error state */
.auth-input.input-error {
    border-color: rgba(239,68,68,.5);
    box-shadow: 0 0 0 3px rgba(239,68,68,.10);
}

/* ── Password show/hide toggle ───────────────────────────── */
.auth-eye-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #475569;
    padding: 4px;
    line-height: 1;
    transition: color .2s;
    z-index: 3;
}
.auth-eye-btn:hover { color: #94a3b8; }

/* ── Field-level error message ───────────────────────────── */
.auth-field-error {
    font-size: 0.78rem;
    color: #f87171;
    display: none;
    align-items: center;
    gap: 5px;
}
.auth-field-error.visible { display: flex; }

/* ── Global form error banner ────────────────────────────── */
.auth-error-banner {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(239,68,68,.10);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #fca5a5;
    animation: shakeBanner .35s ease;
}
.auth-error-banner.visible { display: flex; }
.auth-error-banner .err-icon { font-size: 1rem; flex-shrink: 0; }

@keyframes shakeBanner {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ── Success banner ──────────────────────────────────────── */
.auth-success-banner {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(34,197,94,.10);
    border: 1px solid rgba(34,197,94,.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #86efac;
}
.auth-success-banner.visible { display: flex; }

/* ── Submit button ───────────────────────────────────────── */
.auth-submit-btn {
    position: relative;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #7c3aed 100%);
    background-size: 200% auto;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    overflow: hidden;
    transition: background-position .4s ease, transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 6px 24px rgba(37,99,235,.35);
    margin-top: 4px;
}
.auth-submit-btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(37,99,235,.5);
}
.auth-submit-btn:active { transform: translateY(0); }

/* Shimmer sweep on hover */
.auth-submit-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.20), transparent);
    transform: skewX(-20deg);
    transition: none;
}
.auth-submit-btn:hover::after { left: 160%; transition: left .55s ease; }

/* Loading state */
.auth-submit-btn.loading {
    pointer-events: none;
    opacity: .75;
}
.auth-submit-btn.loading::before {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin .7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ── Footer link (switch between login / register) ────────── */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85rem;
    color: #475569;
}
.auth-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
}
.auth-footer a:hover { color: #93c5fd; }

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    font-size: 0.8rem;
    margin: 4px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.07);
}

/* ── Back to site link ───────────────────────────────────── */
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #475569;
    text-decoration: none;
    transition: color .2s;
    margin-bottom: 18px;
}
.auth-back-link:hover { color: #94a3b8; }

/* ============================================================
   AVATAR BUTTON  (header — all pages)
   The circular avatar that appears next to "Order Now"
   when a user is logged in.
   ============================================================ */
.av-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* The circle button itself */
.av-btn {
    --av-size: 42px;
    width: var(--av-size);
    height: var(--av-size);
    border-radius: 50%;
    border: 2px solid rgba(59,130,246,.45);
    background: rgba(37,99,235,.15);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--av-size) * 0.46);
    line-height: 1;
    transition: border-color .25s, box-shadow .25s, transform .25s;
    position: relative;
    text-decoration: none;
    /* hidden by default — shown by JS when logged in */
    opacity: 0;
    pointer-events: none;
    transform: scale(.7);
}
.av-btn.av-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1),
                border-color .25s, box-shadow .25s;
}
.av-btn:hover {
    border-color: rgba(59,130,246,.8);
    box-shadow: 0 0 0 3px rgba(59,130,246,.18), 0 0 18px rgba(59,130,246,.3);
    transform: scale(1.08);
}

/* Custom image inside the button */
.av-btn img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ── Dropdown menu ─────────────────────────────────────────*/
.av-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: rgba(11,18,38,.92);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    padding: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
    z-index: 9999;

    /* Hidden by default */
    opacity: 0;
    transform: translateY(-8px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s cubic-bezier(.25,1,.5,1);
}
.av-dropdown.av-dd-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Dropdown arrow tip */
.av-dropdown::before {
    content: '';
    position: absolute;
    top: -6px; right: 14px;
    width: 12px; height: 12px;
    background: rgba(11,18,38,.92);
    border-left: 1px solid rgba(255,255,255,.09);
    border-top: 1px solid rgba(255,255,255,.09);
    transform: rotate(45deg);
}

/* User info row */
.av-dd-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 6px;
}
.av-dd-avatar {
    --av-size: 36px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(59,130,246,.4);
    background: rgba(37,99,235,.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
}
.av-dd-avatar img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
}
.av-dd-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.av-dd-email {
    font-size: 0.73rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

/* Dropdown links */
.av-dd-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background .2s, color .2s;
    font-family: 'Poppins', sans-serif;
}
.av-dd-link:hover {
    background: rgba(59,130,246,.10);
    color: #e2e8f0;
}
.av-dd-link .dd-icon { font-size: 1rem; width: 20px; text-align: center; }

/* Logout — red tint */
.av-dd-link.dd-logout:hover {
    background: rgba(239,68,68,.10);
    color: #fca5a5;
}

/* Separator */
.av-dd-sep {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: 6px 0;
}

/* ============================================================
   TOAST NOTIFICATION
   Small pop-up used for "Logged out", "Profile saved" etc.
   ============================================================ */
.auth-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(11,18,38,.95);
    border: 1px solid rgba(59,130,246,.3);
    border-radius: 30px;
    padding: 11px 22px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    backdrop-filter: blur(16px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.auth-toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.auth-toast.toast-error {
    border-color: rgba(239,68,68,.35);
    color: #fca5a5;
}
.auth-toast.toast-success {
    border-color: rgba(34,197,94,.35);
    color: #86efac;
}

/* ── Utility: show/hide ────────────────────────────────────── */
.auth-hidden { display: none !important; }

/* ── Social Sign-In Layout Additions ──────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-divider:not(:empty)::before { margin-right: 15px; }
.auth-divider:not(:empty)::after { margin-left: 15px; }

.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 11px 16px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-btn:active {
    transform: translateY(0);
}

/* Discord Specific Custom Brand Accents */
.discord-btn:hover {
    background: #5865F2;
    border-color: #4752C4;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.35);
}

/* Google Specific Custom Brand Accents */
.google-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #1e293b;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.social-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.social-btn:hover .social-icon {
    transform: scale(1.05);
}

/* Add to auth.css */
.nav-signin-link {
    position: relative;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 6px 2px;
    transition: color 0.25s ease;
}

.nav-signin-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.25s ease;
    border-radius: 2px;
}

.nav-signin-link:hover {
    color: #fff;
}

.nav-signin-link:hover::after {
    width: 100%;
}