﻿/* ─── TOKENS ─────────────────────────────────────────── */
:root {
    --indigo: #5b4fcf;
    --indigo-light: #7c6fe0;
    --bg: #0f0f1a;
    --surface: #181828;
    --surface-2: #1e1e32;
    --border: rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.15);
    --border-focus: rgba(91,79,207,0.6);
    --text: #eef0ff;
    --text-muted: rgba(238,240,255,0.45);
    --text-sub: rgba(238,240,255,0.65);
    --error-bg: rgba(220, 53, 69, 0.12);
    --error-text: #fc8181;
    --error-border: rgba(220, 53, 69, 0.35);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 18px;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── PAGE ───────────────────────────────────────────── */
html, body {
    height: 100%;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(ellipse 600px 500px at 80% -10%, rgba(91,79,207,0.22) 0%, transparent 70%), radial-gradient(ellipse 500px 400px at -5% 90%, rgba(232,67,147,0.14) 0%, transparent 70%);
}

    body::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        background: radial-gradient(circle, rgba(91,79,207,0.15), transparent 70%);
        border-radius: 50%;
        top: -250px;
        right: -200px;
        pointer-events: none;
    }

    body::after {
        content: '';
        position: absolute;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(232,67,147,0.12), transparent 70%);
        border-radius: 50%;
        bottom: -200px;
        left: -150px;
        pointer-events: none;
    }

/* ─── REGISTER BOX ───────────────────────────────────── */
.register-box {
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    animation: slideIn 0.5s ease;
    border: 1px solid var(--border);
}

    /* ─── ICON ───────────────────────────────────────────── */
    .register-box .icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, var(--indigo), var(--indigo-light));
        border-radius: 50%;
        margin: 0 auto 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 38px;
        color: white;
        box-shadow: 0 8px 24px rgba(91,79,207,0.45);
    }

    /* ─── TITLE ──────────────────────────────────────────── */
    .register-box h2 {
        text-align: center;
        margin-bottom: 28px;
        color: var(--text);
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

/* ─── SERVER MESSAGE ─────────────────────────────────── */
.server-message {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    border-left: 3px solid var(--error-border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    text-align: left;
    display: none;
    animation: slideDown 0.3s ease;
}

/* ─── INPUT GROUP ────────────────────────────────────── */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

    .input-group input {
        width: 100%;
        padding: 14px 16px 14px 50px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        font-family: 'Sora', sans-serif;
        font-size: 15px;
        transition: all 0.25s;
        background: var(--surface-2);
        color: var(--text);
    }

        .input-group input::placeholder {
            color: var(--text-muted);
            font-size: 14px;
        }

        .input-group input:focus {
            outline: none;
            border-color: var(--border-focus);
            background: var(--surface-2);
            box-shadow: 0 0 0 3px rgba(91,79,207,0.15);
            transform: translateY(-1px);
        }

        .input-group input.error {
            border-color: var(--error-border);
            background: var(--error-bg);
        }

    /* Icons */
    .input-group.name::before {
        content: '👤';
        position: absolute;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        pointer-events: none;
        z-index: 1;
    }

    .input-group.password::before {
        content: '🔒';
        position: absolute;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        pointer-events: none;
        z-index: 1;
    }

/* ─── ERROR MESSAGE ──────────────────────────────────── */
.error-message {
    color: var(--error-text);
    font-size: 12px;
    margin-top: 6px;
    margin-left: 6px;
    display: none;
    animation: shake 0.3s ease;
}

    .error-message.show {
        display: block;
    }

/* ─── BUTTON ─────────────────────────────────────────── */
.register-box button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--indigo), var(--indigo-light));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(91,79,207,0.4);
    margin-top: 6px;
}

    .register-box button:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 32px rgba(91,79,207,0.55);
    }

    .register-box button:active {
        transform: translateY(-1px);
    }

/* ─── TERMS ──────────────────────────────────────────── */
.terms {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 18px;
    line-height: 1.6;
}

    .terms a {
        color: var(--indigo-light);
        text-decoration: none;
        transition: color 0.2s;
    }

        .terms a:hover {
            color: var(--text);
            text-decoration: underline;
        }

/* ─── LINK ───────────────────────────────────────────── */
.register-box .link {
    display: block;
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--indigo-light);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

    .register-box .link:hover {
        color: var(--text);
        text-decoration: underline;
    }

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .register-box {
        padding: 32px 24px;
        max-width: 100%;
    }

        .register-box .icon {
            width: 70px;
            height: 70px;
            font-size: 34px;
            margin-bottom: 20px;
        }

        .register-box h2 {
            font-size: 22px;
            margin-bottom: 24px;
        }

    .input-group {
        margin-bottom: 14px;
    }

        .input-group input {
            padding: 13px 16px 13px 48px;
            font-size: 14px;
        }

        .input-group::before {
            left: 16px;
            font-size: 17px;
        }

    .register-box button {
        padding: 14px;
        font-size: 14px;
    }

    .terms {
        font-size: 11px;
        margin-top: 16px;
    }

    .register-box .link {
        font-size: 13px;
        margin-top: 16px;
    }
}

@media (max-width: 360px) {
    .register-box {
        padding: 28px 20px;
    }

        .register-box .icon {
            width: 64px;
            height: 64px;
            font-size: 30px;
        }

        .register-box h2 {
            font-size: 20px;
        }
}
