* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #090d14;
    --surface: #111827;
    --surface-raised: #172033;
    --text: #eef4ff;
    --text-muted: #9aa8bd;
    --border: rgba(255, 255, 255, 0.12);
    --brand: #36c5f0;
    --brand-strong: #7c5cff;
    --accent: #35d399;
    --danger: #ff6b6b;
    --radius: 8px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 16%, rgba(54, 197, 240, 0.17), transparent 32rem),
        radial-gradient(circle at 84% 8%, rgba(124, 92, 255, 0.15), transparent 30rem),
        linear-gradient(135deg, #070a10 0%, #101827 56%, #0a111d 100%);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.light-mode {
    color-scheme: light;
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --text: #172033;
    --text-muted: #5f6f86;
    --border: rgba(23, 32, 51, 0.12);
    background:
        radial-gradient(circle at 12% 16%, rgba(54, 197, 240, 0.18), transparent 32rem),
        radial-gradient(circle at 84% 8%, rgba(124, 92, 255, 0.12), transparent 30rem),
        linear-gradient(135deg, #fbfdff 0%, #eef5fa 56%, #f7f9fc 100%);
}

a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 750;
}

a:hover {
    color: #80dcff;
}

button,
input,
select,
textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid rgba(54, 197, 240, 0.55);
    outline-offset: 2px;
}

.container {
    display: grid;
    min-height: 100vh;
    place-items: center;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 34px 20px;
}

.form-container {
    width: min(430px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035)),
        rgba(17, 24, 39, 0.84);
    box-shadow: var(--shadow);
    animation: fadeInForm 0.22s ease-out;
}

body.light-mode .form-container,
body.light-mode .discord-column {
    background-color: rgba(255, 255, 255, 0.82);
}

.form-container h2 {
    margin: 0 0 22px;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: 0;
}

.auth-form {
    display: grid;
    gap: 15px;
}

.form-group {
    text-align: left;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: rgba(23, 32, 51, 0.055);
}

.theme-toggle-corner {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    gap: 8px;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.auth-home-link {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px 0 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.auth-home-link img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
}

.auth-home-link span {
    font-weight: 850;
}

body.light-mode .theme-toggle-corner {
    background: rgba(255, 255, 255, 0.78);
}

body.light-mode .auth-home-link {
    background: rgba(255, 255, 255, 0.78);
}

button:disabled,
.btn-grad:disabled {
    cursor: wait;
    opacity: 0.72;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(54, 197, 240, 0.6);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 4px rgba(54, 197, 240, 0.12);
}

input[readonly],
input:disabled {
    color: #7f8da3;
    cursor: not-allowed;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.form-group.password-wrapper .toggle-password {
    top: 70%;
}

.toggle-password:hover {
    color: var(--text);
}

button,
.btn-grad,
.discord-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 850;
}

.btn-grad {
    width: 100%;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: 0 14px 34px rgba(54, 197, 240, 0.2);
}

.btn-grad:hover,
.discord-button:hover {
    filter: brightness(1.08);
}

.auth-form p {
    margin: 4px 0 0;
    color: var(--text-muted);
    text-align: center;
}

.message,
#message {
    min-height: 0;
    color: var(--danger);
}

.error-message {
    color: var(--danger);
}

.success-message {
    color: var(--accent);
}

.register-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: stretch;
    width: min(940px, 100%);
}

.form-column,
.discord-column {
    min-width: 0;
}

.register-page .form-container {
    width: 100%;
}

.discord-column {
    display: grid;
    place-items: center;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(88, 101, 242, 0.16), rgba(255, 255, 255, 0.035)),
        rgba(17, 24, 39, 0.8);
    box-shadow: var(--shadow);
}

.discord-info {
    text-align: left;
}

.discord-info h3 {
    margin: 22px 0 8px;
    font-size: 22px;
}

.discord-info p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.discord-button {
    gap: 9px;
    width: 100%;
    padding: 0 18px;
    background: #5865f2;
    color: #fff;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.btn-toggle {
    min-height: 36px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (max-width: 820px) {
    .container {
        padding: 18px;
    }

    .register-container {
        grid-template-columns: 1fr;
    }

    .discord-info {
        text-align: center;
    }
}
