* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-from: #e0f2fe;
    --bg-via: #fff7ed;
    --bg-to: #fffbeb;
    --card-bg: #ffffff;
    --card-border: #fde8d8;
    --card-header-bg: #fff8f5;
    --card-header-border: #fde3d0;
    --text-main: #111827;
    --text-muted: #6b7280;
    --link: #fe795d;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --success-text: #166534;
    --input-bg: #ffffff;
    --input-border: #e5d5cc;
    --input-border-focus: #fe795d;
    --button-bg: #fe795d;
    --button-bg-hover: #f56444;
    --label-color: #374151;
}

body.auth-page {
    background: linear-gradient(
        135deg,
        var(--bg-from) 0%,
        var(--bg-via) 50%,
        var(--bg-to) 100%
    );
    color: var(--text-main);
    font-family:
        "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    min-height: 100vh;
    margin: 0;
}

.brand-logo {
    border-radius: 10px;
    display: block;
    height: 10em;
    margin: 0 auto;
    object-fit: contain;
    width: 10em;
}

.auth-main {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
}

.auth-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow:
        0 8px 40px rgba(254, 121, 93, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 460px;
    overflow: hidden;
    width: 100%;
}

.locale-switcher {
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 213, 204, 0.9);
    border-radius: 999px;
    box-shadow:
        0 10px 28px rgba(17, 24, 39, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    display: inline-flex;
    gap: 2px;
    justify-content: flex-end;
    margin: 0;
    padding: 3px;
    width: fit-content;
}

.locale-switcher a {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    min-width: 74px;
    padding: 7px 12px;
    text-decoration: none;
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.locale-switcher a:hover {
    background: rgba(255, 241, 235, 0.9);
    color: var(--text-main);
}

.locale-switcher a:focus-visible {
    outline: 2px solid rgba(254, 121, 93, 0.45);
    outline-offset: 2px;
}

.locale-switcher a.active {
    background: var(--button-bg);
    box-shadow: 0 6px 16px rgba(254, 121, 93, 0.28);
    color: #ffffff;
}

.locale-switcher a:active {
    transform: translateY(1px);
}

.auth-card-header {
    background: var(--card-header-bg);
    border-bottom: 1px solid var(--card-header-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 28px 24px;
    text-align: center;
}

.auth-card-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: var(--text-main);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.content {
    padding: 28px;
}

form {
    width: 100%;
}

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

label {
    color: var(--label-color);
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="email"],
input[type="text"],
input[type="password"] {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    padding: 11px 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    width: 100%;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #b0a09a;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 3px rgba(254, 121, 93, 0.15);
}

.flash-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 10px;
    color: var(--danger-text);
    font-size: 0.88rem;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.flash-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 10px;
    color: var(--success-text);
    font-size: 0.88rem;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.btn {
    background: var(--button-bg);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 8px;
    padding: 12px 16px;
    transition:
        background 0.2s ease,
        transform 0.12s ease;
    width: 100%;
}

.btn:hover {
    background: var(--button-bg-hover);
}

.btn:active {
    transform: translateY(1px);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
    text-align: center;
}

.auth-links a,
.login-link a {
    color: var(--link);
    font-size: 0.88rem;
    text-decoration: none;
}

.auth-links a:hover,
.login-link a:hover {
    text-decoration: underline;
}

.auth-body-copy {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 18px;
}

.name-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 520px) {
    .auth-main {
        align-items: flex-start;
    }

    .auth-card-header {
        padding: 26px 20px 20px;
    }

    .content {
        padding: 22px 20px;
    }

    .name-row {
        grid-template-columns: 1fr;
    }
}
