:root {
    color-scheme: dark;
    --page: #090d13;
    --surface: #111824;
    --surface-raised: #151f2e;
    --border: #283449;
    --text: #f4f6f9;
    --muted: #9da9ba;
    --gold: #d7ad4f;
    --gold-bright: #f1ce73;
    --gold-ink: #1c1608;
    --danger: #ff8f8f;
    --success: #8fe0b0;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    background:
        radial-gradient(circle at 50% -20%, rgba(215, 173, 79, 0.14), transparent 40rem),
        var(--page);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

.topbar {
    width: min(100% - 2rem, 1080px);
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wordmark {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.wordmark span {
    color: var(--gold-bright);
}

.page-shell {
    width: min(100% - 2rem, 680px);
    margin: 0 auto;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 0;
}

.generator-shell {
    min-height: calc(100vh - 72px);
    display: grid;
    align-items: start;
    padding: clamp(2rem, 8vh, 5.5rem) 0 4rem;
}

.card {
    background: linear-gradient(145deg, rgba(21, 31, 46, 0.98), rgba(14, 21, 31, 0.98));
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-card {
    width: min(100%, 440px);
    padding: clamp(2rem, 7vw, 3rem);
    text-align: center;
}

.generator-card {
    padding: clamp(1.5rem, 6vw, 3rem);
}

.brand-mark {
    width: 58px;
    height: 58px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(241, 206, 115, 0.6);
    border-radius: 50%;
    background: rgba(215, 173, 79, 0.08);
    color: var(--gold-bright);
    font-weight: 800;
    letter-spacing: 0.08em;
}

h1 {
    margin: 0 0 2rem;
    font-size: clamp(1.55rem, 5vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.form-stack {
    display: grid;
    gap: 1.25rem;
    text-align: left;
}

.field-group {
    display: grid;
    gap: 0.55rem;
}

label {
    color: #e8edf5;
    font-size: 0.94rem;
    font-weight: 650;
}

input {
    width: 100%;
    min-height: 50px;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #0c121b;
    color: var(--text);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
    color: #657286;
}

input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(215, 173, 79, 0.14);
}

input:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

button {
    min-height: 48px;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
}

button:not(:disabled):active {
    transform: translateY(1px);
}

.primary-button {
    width: 100%;
    border: 1px solid var(--gold);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: var(--gold-ink);
}

.primary-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #f7dd96, #dfb755);
}

.secondary-button,
.copy-button,
.text-button {
    border: 1px solid var(--border);
    background: transparent;
    color: #d8dfeb;
}

.secondary-button:hover,
.copy-button:hover,
.text-button:hover {
    border-color: #52617a;
    background: rgba(255, 255, 255, 0.035);
}

.text-button {
    min-height: 38px;
    padding: 0.35rem 0.85rem;
    font-size: 0.88rem;
}

.message {
    margin: -0.3rem 0 0;
    font-size: 0.91rem;
}

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

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

.result-block {
    margin-top: 2rem;
    display: grid;
    gap: 0.6rem;
}

.result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.password-output {
    min-width: 0;
    color: var(--gold-bright);
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(1.25rem, 5vw, 1.7rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
}

.copy-button {
    min-width: 110px;
    padding: 0.7rem 1rem;
}

.contact-message {
    margin: 1.5rem 0 0;
    padding: 1rem;
    border: 1px solid rgba(255, 143, 143, 0.28);
    border-radius: 11px;
    background: rgba(255, 143, 143, 0.06);
    font-weight: 650;
    text-align: center;
}

.clear-form {
    margin-top: 1.25rem;
}

.clear-form .secondary-button {
    width: 100%;
}

@media (max-width: 520px) {
    .topbar {
        height: 64px;
    }

    .generator-shell {
        min-height: calc(100vh - 64px);
        padding-top: 1.25rem;
    }

    .card {
        border-radius: 17px;
    }

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

    .copy-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
