/* ═══════════════════════════════════════════════════════
   OBSSN — Premium Auth & Pricing Visuals
   Load on login.php, register.php, pricing.php
   AFTER style.css — NO logic modified.
   ═══════════════════════════════════════════════════════ */

/* ── AMBIENT BACKGROUND — Animated gold particles ────── */
.auth-page,
body:has(.pricing-page) {
    position: relative;
    overflow: hidden;
}

.auth-page::before,
body:has(.pricing-page)::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(201,169,98,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 70%, rgba(201,169,98,0.03) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 50% 50%, rgba(201,169,98,0.02) 0%, transparent 70%);
    animation: uxAmbientDrift 12s ease-in-out infinite alternate;
}

@keyframes uxAmbientDrift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 10px) scale(1.05); }
    100% { transform: translate(15px, -15px) scale(1); }
}

/* Floating gold dust */
.auth-page::after,
body:has(.pricing-page)::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 15% 25%, rgba(201,169,98,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 65%, rgba(201,169,98,0.25) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 75% 35%, rgba(201,169,98,0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 80%, rgba(201,169,98,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 85%, rgba(201,169,98,0.2) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 15%, rgba(201,169,98,0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 50%, rgba(201,169,98,0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 55%, rgba(201,169,98,0.2) 0%, transparent 100%);
    animation: uxDustFloat 20s linear infinite;
}

@keyframes uxDustFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-30px); }
}


/* ══════════════════════════════════════════════════════
   AUTH CARD — Login & Register
   ══════════════════════════════════════════════════════ */

.auth-card {
    position: relative;
    z-index: 1;
    border-color: rgba(201,169,98,0.12) !important;
    box-shadow:
        0 0 0 1px rgba(201,169,98,0.06),
        0 24px 80px rgba(0,0,0,0.5),
        0 0 60px rgba(201,169,98,0.03) !important;
    animation: uxCardEntrance 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    background: rgba(14,14,20,0.85) !important;
}

@keyframes uxCardEntrance {
    0% { opacity: 0; transform: translateY(30px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Gold line across top of card */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(201,169,98,0.5) 50%, transparent 90%);
    pointer-events: none;
}

/* Logo entrance */
.auth-card__logo {
    animation: uxLogoFloat 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes uxLogoFloat {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Title entrance */
.auth-card__title {
    animation: uxAuthTitle 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both !important;
}
@keyframes uxAuthTitle {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auth-card__subtitle {
    animation: uxAuthTitle 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* ── Input Focus Effects ─────────────────────────────── */
.auth-card .form-input {
    border-color: rgba(255,255,255,0.08) !important;
    background: rgba(5,5,8,0.6) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

.auth-card .form-input:focus {
    border-color: rgba(201,169,98,0.5) !important;
    box-shadow: 0 0 0 3px rgba(201,169,98,0.08), 0 0 20px rgba(201,169,98,0.04) !important;
    background: rgba(5,5,8,0.8) !important;
}

.auth-card .form-input::placeholder {
    color: rgba(255,255,255,0.2) !important;
    transition: color 0.2s;
}
.auth-card .form-input:focus::placeholder {
    color: rgba(255,255,255,0.35) !important;
}

/* Labels fade in */
.auth-card .form-group {
    animation: uxFormStagger 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-card .form-group:nth-child(1) { animation-delay: 0.35s; }
.auth-card .form-group:nth-child(2) { animation-delay: 0.4s; }
.auth-card .form-group:nth-child(3) { animation-delay: 0.45s; }
.auth-card .form-group:nth-child(4) { animation-delay: 0.5s; }
.auth-card .form-group:nth-child(5) { animation-delay: 0.55s; }
.auth-card .form-group:nth-child(6) { animation-delay: 0.6s; }

@keyframes uxFormStagger {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── Submit Button — Premium gold ────────────────────── */
.auth-card .btn--primary {
    background: linear-gradient(
        110deg,
        #8B7642 0%, #C9A962 30%, #E5D4A1 50%, #C9A962 70%, #8B7642 100%
    ) !important;
    background-size: 250% 100% !important;
    animation: uxGoldShimmerBtn 4s linear infinite !important;
    color: #000 !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(201,169,98,0.2) !important;
    transition: box-shadow 0.3s, transform 0.2s !important;
}
.auth-card .btn--primary:hover {
    box-shadow: 0 6px 30px rgba(201,169,98,0.35) !important;
    transform: translateY(-1px) !important;
}
.auth-card .btn--primary:active {
    transform: translateY(0) scale(0.99) !important;
}

@keyframes uxGoldShimmerBtn {
    0% { background-position: 150% center; }
    100% { background-position: -150% center; }
}

/* ── Footer link ─────────────────────────────────────── */
.auth-card__footer {
    animation: uxFormStagger 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both;
}
.auth-card__footer a {
    position: relative;
}
.auth-card__footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 0.3s ease;
}
.auth-card__footer a:hover::after {
    width: 100%;
}

/* ── Error alert animation ───────────────────────────── */
.auth-card .alert--error {
    animation: uxShakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes uxShakeError {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}


/* ══════════════════════════════════════════════════════
   PRICING PAGE
   ══════════════════════════════════════════════════════ */

.pricing-page {
    position: relative;
    z-index: 1;
}

/* ── Logo entrance ───────────────────────────────────── */
.pricing-page > div:first-child {
    animation: uxLogoFloat 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Header animations ───────────────────────────────── */
.pricing-title {
    animation: uxPricingTitle 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both !important;
}
@keyframes uxPricingTitle {
    0% { opacity: 0; transform: translateY(20px); letter-spacing: 0.1em; }
    100% { opacity: 1; transform: translateY(0); letter-spacing: normal; }
}

.pricing-subtitle {
    animation: uxFormStagger 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

/* Gold accent text shimmer */
.pricing-title span {
    background: linear-gradient(110deg, #8B7642, #C9A962, #E5D4A1, #C9A962, #8B7642) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    animation: uxGoldTextShimmer 5s linear infinite !important;
}
@keyframes uxGoldTextShimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ── Billing Toggle — Premium ────────────────────────── */
.billing-toggle {
    animation: uxFormStagger 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
    border-color: rgba(201,169,98,0.15) !important;
    background: rgba(14,14,20,0.6) !important;
}

.billing-toggle__btn {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.billing-toggle__btn.active {
    box-shadow: 0 2px 12px rgba(201,169,98,0.25) !important;
}

.save-pill {
    animation: uxSavePulse 2s ease-in-out infinite !important;
}
@keyframes uxSavePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ── Plan Cards — Staggered entrance ─────────────────── */
.plan-card {
    animation: uxPlanCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}
.plan-card:nth-child(1) { animation-delay: 0.5s; }
.plan-card:nth-child(2) { animation-delay: 0.65s; }
.plan-card:nth-child(3) { animation-delay: 0.8s; }

@keyframes uxPlanCardIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card hover glow */
.plan-card:hover {
    box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(201,169,98,0.1) !important;
}

/* Featured card — enhanced glow */
.plan-card--featured {
    border-color: rgba(201,169,98,0.5) !important;
    background: linear-gradient(180deg, rgba(201,169,98,0.03) 0%, rgba(14,14,20,1) 40%) !important;
}
.plan-card--featured:hover {
    box-shadow:
        0 0 0 1px rgba(201,169,98,0.4),
        0 20px 60px rgba(201,169,98,0.12),
        0 0 40px rgba(201,169,98,0.05) !important;
}

/* Featured badge pop */
.plan-badge {
    animation: uxBadgeDrop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s both !important;
}
@keyframes uxBadgeDrop {
    0% { opacity: 0; transform: translateX(-50%) translateY(-15px) scale(0.8); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── Price number animation ──────────────────────────── */
.plan-amount {
    transition: transform 0.3s ease, color 0.3s ease !important;
}
.plan-card:hover .plan-amount {
    transform: scale(1.03);
}

/* ── Feature list stagger ────────────────────────────── */
.plan-features li {
    transition: transform 0.2s ease, color 0.2s ease !important;
}
.plan-card:hover .plan-features li {
    color: var(--color-text) !important;
}
.plan-features li svg {
    transition: transform 0.2s ease !important;
}
.plan-card:hover .plan-features li svg {
    transform: scale(1.15);
}

/* ── CTA Buttons ─────────────────────────────────────── */
.plan-cta--primary {
    background: linear-gradient(
        110deg, #8B7642 0%, #C9A962 30%, #E5D4A1 50%, #C9A962 70%, #8B7642 100%
    ) !important;
    background-size: 250% 100% !important;
    animation: uxGoldShimmerBtn 4s linear infinite !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(201,169,98,0.2) !important;
    transition: box-shadow 0.3s, transform 0.2s !important;
}
.plan-cta--primary:hover {
    box-shadow: 0 6px 30px rgba(201,169,98,0.35) !important;
    transform: translateY(-2px) !important;
    filter: none !important;
}

.plan-cta--secondary {
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}
.plan-cta--secondary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(201,169,98,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.plan-cta--secondary:hover::after {
    transform: translateX(100%);
}

/* ── Free plan card ──────────────────────────────────── */
.pricing-page > div:last-of-type:not(.plans-grid):not(.pricing-header):not(.pricing-back):not(.pricing-note) {
    animation: uxPlanCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

/* ── Pricing note fade in ────────────────────────────── */
.pricing-note {
    animation: uxFormStagger 0.5s cubic-bezier(0.22, 1, 0.36, 1) 1.1s both;
}

/* ── Back link ───────────────────────────────────────── */
.pricing-back a {
    transition: color 0.2s, gap 0.3s !important;
}
.pricing-back a:hover {
    gap: 10px !important;
}


/* ══════════════════════════════════════════════════════
   REGISTER PAGE — Extra styles
   ══════════════════════════════════════════════════════ */

/* Grid name fields stagger */
.auth-card div[style*="grid-template-columns"] .form-group:nth-child(1) { animation-delay: 0.35s; }
.auth-card div[style*="grid-template-columns"] .form-group:nth-child(2) { animation-delay: 0.4s; }

/* Selected tier badge glow */
.auth-card div[style*="rgba(201,169,98,0.08)"] {
    animation: uxTierBadgeGlow 2s ease-in-out infinite !important;
}
@keyframes uxTierBadgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,98,0.15); }
    50% { box-shadow: 0 0 12px 2px rgba(201,169,98,0.08); }
}

/* Checkbox custom styling */
.auth-card input[type="checkbox"] {
    accent-color: #C9A962;
}


/* ══════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .auth-page::before,
    .auth-page::after,
    body:has(.pricing-page)::before,
    body:has(.pricing-page)::after {
        animation: none !important;
    }
    .auth-card,
    .auth-card__logo,
    .auth-card__title,
    .auth-card__subtitle,
    .auth-card .form-group,
    .auth-card__footer,
    .pricing-title,
    .pricing-subtitle,
    .billing-toggle,
    .plan-card,
    .plan-badge,
    .pricing-note,
    .save-pill {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .auth-card .btn--primary,
    .plan-cta--primary {
        animation: none !important;
        background: var(--color-gold) !important;
    }
    .pricing-title span {
        animation: none !important;
        -webkit-text-fill-color: var(--color-gold) !important;
    }
}

/* ══════════════════════════════════════════════════════
   MOBILE ADJUSTMENTS
   ══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .plan-card {
        animation-name: uxPlanCardInMobile !important;
    }
    @keyframes uxPlanCardInMobile {
        0% { opacity: 0; transform: translateY(20px); }
        100% { opacity: 1; transform: translateY(0); }
    }
    .plan-card--featured {
        animation-delay: 0.5s !important;
    }
}
