/* Gamified Auth Styles - Adventure Together Games
   Fantasy board game themed authentication experience */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --game-gold: #F7B32B;
    --game-gold-light: #FFD666;
    --game-gold-dark: #D49A1F;
    --game-gold-rgb: 247, 179, 43;
    --primary-dark: #0D2635;
    --primary-dark-light: #1a3a4a;
}

/* ============================================
   AUTH ELEMENT BASE STYLES
   ============================================ */
.auth-input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus {
    border-color: var(--game-gold);
    box-shadow: 0 0 0 3px rgba(var(--game-gold-rgb), 0.15);
    background: rgba(255, 255, 255, 1);
}

.auth-btn {
    transition: all 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--game-gold-rgb), 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled,
.auth-btn.auth-btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.password-toggle {
    transition: color 0.15s ease;
}

.password-toggle:hover {
    color: var(--game-gold);
}

.social-btn {
    transition: all 0.2s ease;
}

.social-btn:hover {
    border-color: rgba(var(--game-gold-rgb), 0.4);
    box-shadow: 0 2px 8px rgba(var(--game-gold-rgb), 0.15);
}

/* ============================================
   GLASS-MORPHISM CARD
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

@supports not (backdrop-filter: blur(20px)) {
    .glass-card {
        background: rgba(255, 255, 255, 0.97);
    }
}

/* ============================================
   TERRAIN BACKGROUND & OVERLAY
   ============================================ */
.terrain-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.terrain-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(13, 38, 53, 0.82) 0%,
        rgba(13, 38, 53, 0.65) 45%,
        rgba(13, 38, 53, 0.8) 100%
    );
    z-index: 1;
}

.terrain-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: terrainFade 16s ease-in-out infinite;
}

.terrain-image:nth-child(1) { animation-delay: 0s; }
.terrain-image:nth-child(2) { animation-delay: 8s; }

/* ============================================
   HEX GRID OVERLAY
   ============================================ */
.hex-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23F7B32B' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%23F7B32B' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
    animation: hexFloat 20s ease-in-out infinite;
}

/* ============================================
   FLOATING GOLD PARTICLES
   ============================================ */
.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--game-gold), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; width: 3px; height: 3px; }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 1.5s; animation-duration: 9s; width: 5px; height: 5px; }
.particle:nth-child(3) { left: 45%; top: 35%; animation-delay: 3s; animation-duration: 6s; }
.particle:nth-child(4) { left: 70%; top: 75%; animation-delay: 4.5s; animation-duration: 8s; width: 3px; height: 3px; }
.particle:nth-child(5) { left: 85%; top: 15%; animation-delay: 2s; animation-duration: 10s; width: 5px; height: 5px; }
.particle:nth-child(6) { left: 55%; top: 85%; animation-delay: 5s; animation-duration: 7s; }

/* ============================================
   D20 DICE SPINNER
   ============================================ */
.d20-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    animation: diceRoll 1.2s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
    margin-left: -0.25rem;
}

/* ============================================
   GOLD ACCENT OVERRIDES FOR AUTH ELEMENTS
   ============================================ */
.auth-gold-link {
    color: var(--game-gold);
    transition: color 0.2s ease;
}

.auth-gold-link:hover {
    color: var(--game-gold-light);
}

/* Auth button with gold accent */
.auth-btn-gold {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark-light) 100%);
    border: 1px solid rgba(var(--game-gold-rgb), 0.3);
    transition: all 0.2s ease;
}

.auth-btn-gold:hover {
    border-color: rgba(var(--game-gold-rgb), 0.6);
    box-shadow: 0 4px 12px rgba(var(--game-gold-rgb), 0.2), 0 0 0 1px rgba(var(--game-gold-rgb), 0.3);
    transform: translateY(-1px);
}

.auth-btn-gold:active {
    transform: translateY(0);
}

.auth-btn-gold:disabled,
.auth-btn-gold.auth-btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

/* Social buttons on glass card */
.glass-card .social-btn {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
}

.glass-card .social-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(var(--game-gold-rgb), 0.4);
    box-shadow: 0 2px 8px rgba(var(--game-gold-rgb), 0.15);
}

/* Social divider bg match for glass card */
.glass-card .social-divider-text {
    background: rgba(255, 255, 255, 0.92);
}

/* Auth input on glass card - ensure visible */
.glass-card .auth-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

.glass-card .auth-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--game-gold);
    box-shadow: 0 0 0 3px rgba(var(--game-gold-rgb), 0.15);
}

/* Checkbox gold accent */
.glass-card input[type="checkbox"]:checked {
    background-color: var(--game-gold);
    border-color: var(--game-gold);
}

/* ============================================
   LAYOUT: BRAND PANEL (Left Side)
   Hidden by default, shown on wide desktop
   ============================================ */
.brand-panel {
    display: none;
    position: relative;
    color: white;
    z-index: 10;
}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(13, 38, 53, 0.2) 0%, transparent 100%);
    pointer-events: none;
}

.brand-panel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    text-align: center;
    padding: 2rem;
}

.brand-logo {
    height: 3.5rem;
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.4));
}

.brand-heading {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: white;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.brand-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.brand-divider {
    width: 3rem;
    height: 1px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, transparent, rgba(var(--game-gold-rgb), 0.5), transparent);
}

.brand-subtitle {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.brand-panel .gold-accent {
    color: var(--game-gold);
}

/* ============================================
   LAYOUT: AUTH PANEL (Right Side / Main)
   Full width by default, narrower on wide desktop
   ============================================ */
.auth-panel {
    width: 100%;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.auth-panel-inner {
    width: 100%;
    max-width: 440px;
    margin-top: auto;
    margin-bottom: auto;
}

.mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mobile-logo-img {
    height: 2.5rem;
}

.auth-card {
    padding: 1.5rem;
}

/* ============================================
   RESPONSIVE: 640px+ (Tablet)
   ============================================ */
@media (min-width: 640px) {
    .auth-panel {
        padding: 1.5rem;
    }

    .mobile-logo-img {
        height: 3rem;
    }

    .auth-card {
        padding: 2rem;
    }
}

/* ============================================
   RESPONSIVE: 768px+ (Tablet landscape)
   ============================================ */
@media (min-width: 768px) {
    .auth-card {
        padding: 2.5rem;
    }
}

/* ============================================
   RESPONSIVE: 1280px+ (Wide Desktop)
   Show brand panel, shrink auth panel
   ============================================ */
@media (min-width: 1280px) {
    .brand-panel {
        display: flex;
        flex: 1;
        justify-content: flex-end;
    }

    .brand-panel-inner {
        padding: 3rem;
        max-width: 480px;
    }

    .brand-logo {
        height: 4rem;
    }

    .brand-heading {
        font-size: 2.5rem;
    }

    .brand-tagline {
        font-size: 1.125rem;
    }

    .auth-panel {
        flex: 1;
        width: auto;
        justify-content: flex-start;
        padding: 1.5rem 2rem 1.5rem 3rem;
    }

    .mobile-logo {
        display: none;
    }
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes terrainFade {
    0%     { opacity: 0; }
    6%     { opacity: 1; }
    44%    { opacity: 1; }
    50%    { opacity: 0; }
    100%   { opacity: 0; }
}

@keyframes hexFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-15px) rotate(2deg); }
}

@keyframes particleFloat {
    0%   { transform: translateY(0) translateX(0) scale(0); opacity: 0; }
    15%  { opacity: 0.8; transform: scale(1); }
    50%  { transform: translateY(-60px) translateX(20px) scale(1.2); opacity: 0.6; }
    85%  { opacity: 0.3; }
    100% { transform: translateY(-120px) translateX(-10px) scale(0); opacity: 0; }
}

@keyframes diceRoll {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .terrain-image {
        animation: none;
        opacity: 1;
    }
    .terrain-image:nth-child(2) {
        opacity: 0;
    }
    .hex-overlay {
        animation: none;
    }
    .particle {
        display: none;
    }
    .d20-spinner {
        animation-duration: 3s;
    }
}
