:root {
    --auth-red: #ea580c;
    --auth-red-dark: #c2410c;
    --auth-red-soft: #fff7ed;
    --auth-yellow: #f59e0b;
    --auth-ink: #172033;
    --auth-muted: #687084;
    --auth-line: #e5e7eb;
    --auth-canvas: #f6f7f9;
    --auth-white: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-ink);
    background: var(--auth-canvas);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-container {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(520px, 1.08fr) minmax(480px, 0.92fr);
}

.auth-visual {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(2rem, 4vw, 4.5rem);
    color: var(--auth-white);
    background:
        linear-gradient(145deg, rgba(124, 45, 18, 0.45), rgba(77, 24, 8, 0.88)),
        linear-gradient(135deg, #1a0803 0%, #7c2d12 40%, #c2410c 75%, #9a3412 100%);
    background-size: cover;
    background-position: center;
    isolation: isolate;
    cursor: crosshair;
}

.auth-visual::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(31, 11, 4, 0.04), rgba(31, 11, 4, 0.24));
    content: '';
}

.game-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Glassmorphism Game Top Bar (Responsive Flex Header) */
.game-top-bar {
    position: absolute;
    top: clamp(1rem, 2.2vw, 2rem);
    left: clamp(1rem, 2.2vw, 2rem);
    right: clamp(1rem, 2.2vw, 2rem);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    pointer-events: none;
}

.game-hint-badge {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.85rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 999px;
    background: rgba(26, 8, 3, 0.65);
    backdrop-filter: blur(12px);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fef08a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    user-select: none;
    white-space: nowrap;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-hint-badge i {
    font-size: 1rem;
    color: var(--auth-yellow);
    flex-shrink: 0;
}

.hint-text-short {
    display: none;
}

@media (max-width: 1320px) {
    .hint-text-full { display: none; }
    .hint-text-short { display: inline; }
}

@media (max-width: 640px) {
    .game-hint-badge { display: none; }
    .game-top-bar { justify-content: flex-end; }
}

.game-hud {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(26, 8, 3, 0.65);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    user-select: none;
    flex-shrink: 0;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.5rem;
}

.game-stat + .game-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-label {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--auth-yellow);
    line-height: 1.1;
}

.game-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-left: 0.15rem;
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 1rem;
    transition: background 160ms ease, transform 160ms ease;
}

.game-btn-icon:hover {
    background: rgba(245, 158, 11, 0.4);
    transform: rotate(90deg);
}

.visual-content {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    max-width: 720px;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}

.visual-content .brand-card {
    pointer-events: auto;
}

.visual-copy {
    max-width: 650px;
    margin: auto 0;
    padding: clamp(3rem, 10vh, 7rem) 0;
}

.visual-copy h1 {
    max-width: 560px;
    margin: 0 0 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.35rem, 3.5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.visual-copy h1 span {
    color: var(--auth-yellow);
}

.visual-copy p {
    max-width: 480px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    line-height: 1.7;
}

.brand-card {
    width: fit-content;
    max-width: 100%;
    margin-top: clamp(3rem, 9vh, 5rem);
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(62, 20, 0, 0.12);
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-logo-item {
    display: grid;
    min-width: 54px;
    height: 44px;
    padding: 0.45rem 0.65rem;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
}

.brand-logo-item img.logo-square {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.auth-form-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: clamp(2.5rem, 6vw, 6rem);
    background: var(--auth-white);
}

.auth-form-panel::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 220px;
    height: 220px;
    border-radius: 0 0 0 100%;
    background: linear-gradient(225deg, var(--auth-red-soft), rgba(255, 247, 237, 0));
    content: '';
    pointer-events: none;
}

.auth-form-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
}

.form-header {
    margin: 0;
}

.welcome-logo {
    display: block;
    width: 135px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 2rem;
    object-fit: contain;
}

.form-header h2 {
    margin: 0 0 0.65rem;
    color: var(--auth-ink);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.85rem, 2.7vw, 2.05rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.form-header > p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--auth-ink);
    font-size: 0.75rem;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    color: #9ca3af;
    pointer-events: none;
    transition: color 160ms ease;
}

.input-wrapper .input-icon svg {
    width: 18px;
    height: 18px;
}

.input-wrapper input {
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 3rem;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    outline: none;
    color: var(--auth-ink);
    background: var(--auth-white);
    font-size: 0.9rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrapper input::placeholder {
    color: #a3a8b2;
}

.input-wrapper input:focus {
    border-color: var(--auth-red);
    background: var(--auth-white);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.09);
}

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

.toggle-password {
    position: absolute;
    right: 0.75rem;
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    outline: none;
    color: var(--auth-ink);
    background: #f3f4f6;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.btn-auth {
    position: relative;
    display: flex;
    overflow: hidden;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 12px;
    color: var(--auth-white);
    background: var(--auth-red);
    box-shadow: 0 12px 26px rgba(234, 88, 12, 0.2);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn-auth::after {
    margin-left: 0.65rem;
    content: '→';
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 160ms ease;
}

.btn-auth:hover {
    background: var(--auth-red-dark);
    box-shadow: 0 16px 34px rgba(194, 65, 12, 0.28);
    transform: translateY(-1px);
}

.btn-auth:hover::after {
    transform: translateX(3px);
}

.btn-auth:active {
    box-shadow: 0 8px 18px rgba(194, 65, 12, 0.2);
    transform: translateY(0);
}

.btn-auth:focus-visible {
    outline: 3px solid rgba(234, 88, 12, 0.2);
    outline-offset: 3px;
}

.btn-auth:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-auth:disabled::after {
    display: none;
}

.chrome-download-wrap {
    display: none;
    margin-top: 0.8rem;
    text-align: center;
}

.btn-chrome-download {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    color: var(--auth-ink);
    background: var(--auth-white);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.btn-chrome-download:hover {
    border-color: #d1d5db;
    color: var(--auth-ink);
    background: #f9fafb;
}

.btn-chrome-download i {
    font-size: 1.1rem;
    color: var(--auth-red);
}

.auth-footer {
    margin-top: 2rem;
    color: #9ca3af;
    font-size: 0.72rem;
    text-align: center;
}

.mobile-brand-logos {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.mobile-brand-logos img.logo-square {
    width: auto;
    max-width: 32px;
    height: 32px;
    object-fit: contain;
}

@media (max-width: 1100px) {
    .auth-container {
        grid-template-columns: minmax(440px, 0.9fr) minmax(460px, 1.1fr);
    }

    .auth-visual {
        padding: 2.5rem;
    }

    .visual-copy h1 {
        font-size: clamp(2.2rem, 3.6vw, 2.9rem);
    }
}

@media (max-width: 900px) {
    .auth-container {
        display: block;
        background:
            linear-gradient(180deg, rgba(234, 88, 12, 0.08), transparent 240px),
            var(--auth-canvas);
    }

    .auth-visual {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 3rem 1.5rem;
        background: transparent;
    }

    .auth-form-panel::before {
        display: none;
    }

    .auth-form-wrapper {
        max-width: 460px;
        padding: 2.25rem;
        border: 1px solid rgba(229, 231, 235, 0.9);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 24px 60px rgba(23, 32, 51, 0.09);
    }

    .welcome-logo {
        width: 130px;
        margin-bottom: 2rem;
    }

    .mobile-brand-logos {
        display: flex;
    }
}

@media (max-width: 520px) {
    .auth-form-panel {
        align-items: flex-start;
        padding: 1rem;
    }

    .auth-form-wrapper {
        min-height: calc(100dvh - 2rem);
        padding: 1.5rem;
        border-radius: 20px;
    }

    .welcome-logo {
        width: 120px;
        margin-bottom: 1.75rem;
    }

    .form-header h2 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
