@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Nunito:wght@200..1000&display=swap');

/* ═══════════════════════════════════════════════════════════════
   🍬 CANDY COOKIE THEME - "Sweet & Cartoon" Style
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Palette from Reference Image */
    --bg-color: #d38d5f;
    /* Cookie Brown Background */
    --bg-pattern: #c47d50;

    --card-cream: #fff9e6;
    /* Vanilla Cream */
    --card-shadow: #d64d4d;
    /* Darker red/pink for card depth */

    --glaze-pink: #ff6b9d;
    /* The pink frosting */
    --glaze-shadow: #e0467b;

    --input-inner: #f4cda0;
    /* Carved cookie dough */
    --input-text: #ab6534;

    --btn-pink-top: #ff85b3;
    --btn-pink-bottom: #e64585;
    --btn-shadow: #b82e60;

    --text-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka';
    color: var(--text-white);
    height: 100vh;
    height: 100dvh;
    /* Mobile viewport fix */
    overflow: hidden;
    /* Prevent scrolling */
    position: fixed;
    /* Prevent mobile scroll bounce */
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Warm Cookie Background Pattern */
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--bg-pattern) 15%, transparent 16%),
        radial-gradient(var(--bg-pattern) 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

/* ═══════════════════════════════════════════════════════════════
   🌌 BACKGROUND DECORATION
   ═══════════════════════════════════════════════════════════════ */

.candy-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.candy-particle {
    position: absolute;
    font-size: 3rem;
    filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.1));
    animation: float 6s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
   📦 CONTAINER
   ═══════════════════════════════════════════════════════════════ */

.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
}

/* ═══════════════════════════════════════════════════════════════
   🦇 LOGO (Above the card)
   ═══════════════════════════════════════════════════════════════ */

.game-logo {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

.logo-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 5px;
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.2));
    animation: jelly 2s infinite;
}

@keyframes jelly {

    0%,
    100% {
        transform: scale(1, 1);
    }

    25% {
        transform: scale(0.9, 1.1);
    }

    50% {
        transform: scale(1.1, 0.9);
    }

    75% {
        transform: scale(0.95, 1.05);
    }
}

.logo-text {
    font-size: 3.5rem;
    color: #ffffff;
    text-transform: uppercase;
    /* Soft Candy Stroke */
    -webkit-text-stroke: 4px #e64585;
    text-shadow:
        6px 6px 0 #b82e60,
        0 0 0 #fff;
    line-height: 1;
    letter-spacing: 2px;
}

.logo-subtitle {
    color: #ab6534;
    font-weight: 700;
    font-size: 1.2rem;
    background: #fff9e6;
    padding: 5px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 4px 0 #d4a77e;
    transform: rotate(-3deg);
}

/* ═══════════════════════════════════════════════════════════════
   🍪 COOKIE CARD
   ═══════════════════════════════════════════════════════════════ */

.auth-card {
    background: var(--card-cream);
    width: 100%;
    max-width: 400px;
    /* Top padding increased to 100px to fix button "sticking" to header */
    padding: 100px 30px 40px 30px;

    border-radius: 30px;
    position: relative;

    /* The Cookie/Biscuit Depth */
    box-shadow:
        0 10px 0 #d9bc8c,
        /* Crust layer */
        0 18px 0 rgba(0, 0, 0, 0.15);
    /* Drop shadow */

    /* Cookie bite decoration (optional, keeping clean for now) */
    isolation: isolate;
}

/* The Pink "Melting Glaze" Header */
.auth-card::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 10px;
    right: 10px;
    height: 90px;
    background: var(--glaze-pink);
    border-radius: 30px 30px 40% 40%;
    /* Organic melting shape */
    z-index: -1;
    box-shadow:
        inset 0 10px 10px rgba(255, 255, 255, 0.4),
        /* Highlight */
        0 6px 0 var(--glaze-shadow);
    /* Depth */
}

/* Drips for the Melting Glaze */
.auth-title {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 0 var(--glaze-shadow);
    z-index: 5;
}

/* ═══════════════════════════════════════════════════════════════
   📝 FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: none;
    /* Hide labels for cleaner "Game UI" look, rely on placeholders */
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--input-text);

    /* Carved "Dough" Look */
    background: var(--input-inner);
    border: none;
    border-radius: 50px;
    /* Pill shape */

    /* Inner shadow for carving effect */
    box-shadow: inset 0 4px 8px rgba(171, 101, 52, 0.3);
    outline: none;
    transition: all 0.2s;
}

.form-input::placeholder {
    color: rgba(171, 101, 52, 0.6);
}

.form-input:focus {
    background: #fff;
    box-shadow:
        inset 0 2px 4px rgba(171, 101, 52, 0.1),
        0 0 0 4px var(--glaze-pink);
}

.form-input.error {
    background: #ffdbdb;
    box-shadow: inset 0 0 0 2px #ff6b6b;
}

.error-message {
    color: #e64585;
    font-weight: 700;
    margin-top: 5px;
    font-size: 0.9rem;
    text-align: center;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 20px 0;
    cursor: pointer;
    justify-content: center;
}

.checkbox-input {
    width: 24px;
    height: 24px;
    background: var(--input-inner);
    border-radius: 6px;
    appearance: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.checkbox-input:checked::after {
    content: '✓';
    color: var(--btn-pink-bottom);
    font-size: 18px;
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label {
    color: #c47d50;
    font-weight: 700;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   🔘 JELLY BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    font-size: 1.4rem;
    color: white;
    text-decoration: none;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);

    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s;
}

/* Pink "Jelly" Button */
.btn-primary {
    background: linear-gradient(to bottom, var(--btn-pink-top), var(--btn-pink-bottom));
    /* The 3D Depth */
    box-shadow:
        0 6px 0 var(--btn-shadow),
        /* Bottom 3D slab */
        0 12px 10px rgba(0, 0, 0, 0.2),
        /* Drop shadow */
        inset 0 4px 4px rgba(255, 255, 255, 0.4);
    /* Top highlight */
}

.btn-guest {
    background: linear-gradient(to bottom, var(--btn-pink-top), var(--btn-pink-bottom));
    /* 3D Depth + Margin Fix */
    box-shadow:
        0 6px 0 var(--btn-shadow),
        0 12px 10px rgba(0, 0, 0, 0.2),
        inset 0 4px 4px rgba(255, 255, 255, 0.4);

    margin-top: 10px;
    /* Small margin to separate from the header area */
}

/* Button "Reflection" pill shape */
.btn::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 15px;
    right: 15px;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1));
    border-radius: 30px;
    pointer-events: none;
}

.btn:active {
    transform: translateY(6px);
    /* Press down effect */
    box-shadow:
        0 0 0 var(--btn-shadow),
        inset 0 4px 4px rgba(0, 0, 0, 0.2);
    /* Inset shadow when pressed */
}

/* ═══════════════════════════════════════════════════════════════
   🔗 BOTTOM LINKS
   ═══════════════════════════════════════════════════════════════ */

.auth-footer {
    text-align: center;
    margin-top: 35px;
    /* Added significant top margin */
    padding-top: 15px;
    border-top: 2px dashed rgba(196, 125, 80, 0.2);
    /* Subtle separator line */
}

.auth-footer p {
    color: #c47d50;
    /* Darker cookie color for visibility */
    font-weight: 700;
}

.auth-link {
    color: var(--btn-pink-bottom);
    font-weight: 800;
    text-decoration: none;
    font-size: 1.1rem;
}

.auth-link:hover {
    text-decoration: underline;
}

.guest-info {
    text-align: center;
    color: #c47d50;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    color: #c47d50;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 3px;
    background: #f4cda0;
    border-radius: 2px;
    margin: 0 10px;
}

/* ═══════════════════════════════════════════════════════════════
   📊 CONVERT STATS
   ═══════════════════════════════════════════════════════════════ */

.current-stats {
    background: #fff;
    border: 3px dashed #d9bc8c;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-label {
    color: #c47d50;
    font-weight: 700;
    font-size: 0.85rem;
}

.stat-value {
    color: var(--btn-pink-bottom);
    font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   🔄 LOADER
   ═══════════════════════════════════════════════════════════════ */

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    /* Match dashboard background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #fff;
    border-top-color: var(--glaze-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: #fff;
    /* White text like dashboard */
    font-size: 1.2rem;
    margin-top: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   ⚠️ ANIMATION & RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-8px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(8px, 0, 0);
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
        justify-content: flex-start;
        /* Mobilde üstten başlasın */
        padding-top: 20px;
    }

    .auth-card {
        padding: 60px 20px 20px 20px;
        /* Reduce top padding */
        max-width: 100%;
    }

    /* Scale down logo */
    .logo-icon {
        font-size: 3.5rem;
    }

    .logo-text {
        font-size: 2.2rem;
    }

    .logo-subtitle {
        font-size: 0.9rem;
        padding: 4px 12px;
    }

    .game-logo {
        margin-bottom: 15px;
    }

    /* Compact Form */
    .auth-title {
        font-size: 1.5rem;
        top: 10px;
    }

    .auth-card::before {
        height: 60px;
    }

    /* Smaller glaze */

    .form-group {
        margin-bottom: 10px;
    }

    .form-input {
        padding: 12px 15px;
        font-size: 1rem;
    }

    .btn {
        height: 50px;
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .guest-info {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .divider {
        margin: 10px 0;
        font-size: 0.8rem;
    }

    .checkbox-group {
        margin: 5px 0 15px 0;
    }

    .auth-footer {
        margin-top: 15px;
        padding-top: 10px;
    }
}