:root {
    color-scheme: light;
    --bg: #101712;
    --surface: rgba(255, 255, 255, 0.96);
    --ink: #17201c;
    --muted: #68746f;
    --border: #dfe6e2;
    --gold: #c49a37;
    --gold-soft: #f3df9c;
    --green: #2c665d;
    --risk: #a94438;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(145deg, rgba(16, 23, 18, 0.96), rgba(44, 102, 93, 0.76)),
        #101712;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid rgba(242, 227, 184, 0.35);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.auth-card:hover {
    border-color: rgba(196, 154, 55, 0.52);
    box-shadow: 0 30px 86px rgba(0, 0, 0, 0.26);
    transform: translateY(-3px);
}

.register-card {
    width: min(100%, 760px);
}

.logo-block {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-logo {
    width: min(280px, 82vw);
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.2));
}

.logo-block h1 {
    margin: 0;
    color: var(--gold);
    font-size: clamp(1.6rem, 5vw, 2.3rem);
    font-weight: 900;
    line-height: 1.1;
}

.field-list,
.field-grid {
    display: grid;
    gap: 14px;
}

.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 8px;
}

label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8faf9;
    color: var(--ink);
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
    border-color: rgba(44, 102, 93, 0.74);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(44, 102, 93, 0.12);
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-button {
    background: var(--green);
    color: #fff;
    box-shadow: 0 12px 28px rgba(44, 102, 93, 0.22);
}

.secondary-button {
    background: linear-gradient(135deg, #d8b650, #b98d2e);
    color: #17201c;
    box-shadow: 0 12px 28px rgba(196, 154, 55, 0.24);
}

.primary-button:hover,
.secondary-button:hover {
    filter: saturate(1.08);
    transform: translateY(-2px);
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.7;
    text-align: center;
}

.auth-switch a {
    color: var(--green);
    font-weight: 900;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.message-panel {
    margin-bottom: 16px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 800;
    line-height: 1.6;
}

.message-panel.success {
    border-color: rgba(44, 102, 93, 0.32);
    background: #eef7f4;
    color: var(--green);
}

.message-panel.error {
    border-color: rgba(169, 68, 56, 0.3);
    background: #fff4f2;
    color: var(--risk);
}

@media (max-width: 640px) {
    .auth-shell {
        align-items: start;
        padding: 16px;
    }

    .auth-card {
        padding: 20px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .auth-logo {
        width: min(240px, 78vw);
        max-height: 130px;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 16px;
    }

    .auth-logo {
        width: min(210px, 76vw);
    }
}
