:root {
    --gold: #d4af37;
    --gold-soft: rgba(212, 175, 55, 0.18);
    --text: #f4f0e4;
    --muted: rgba(244, 240, 228, 0.58);
    --panel: rgba(10, 10, 9, 0.72);
    --line: rgba(212, 175, 55, 0.22);
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    background: #030303;
    color: var(--text);
    font-family: "Noto Serif SC", serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 22% 30%, rgba(212, 175, 55, 0.12), transparent 34%),
        radial-gradient(circle at 82% 72%, rgba(212, 175, 55, 0.08), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 34%),
        #050504;
}

.auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.9%22 numOctaves=%224%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22 opacity=%220.8%22/%3E%3C/svg%3E');
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 42px 72px 56px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 44px;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border: 2px solid var(--gold);
    display: grid;
    place-items: center;
    transform: rotate(45deg);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.brand-mark span {
    display: block;
    transform: rotate(-45deg);
    color: var(--gold);
    font: 900 24px "Cinzel", serif;
}

.brand-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.22em;
    white-space: nowrap;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    color: rgba(255, 255, 255, 0.46);
    font: 900 15px "Cinzel", "Noto Serif SC", serif;
    letter-spacing: 0.22em;
}

.auth-nav a {
    transition: color 0.24s ease;
}

.auth-nav a:hover,
.auth-nav a.active {
    color: var(--gold);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 520px);
    align-items: center;
    gap: 80px;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

.auth-copy {
    padding-bottom: 32px;
}

.auth-kicker {
    margin: 0 0 22px;
    color: var(--gold);
    font: 900 12px "Cinzel", serif;
    letter-spacing: 0.42em;
    text-transform: uppercase;
}

.auth-title {
    margin: 0;
    max-width: 680px;
    font-size: clamp(3rem, 6vw, 6.8rem);
    line-height: 1.05;
    letter-spacing: 0.12em;
    font-weight: 900;
}

.auth-subtitle {
    margin: 28px 0 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 17px;
    line-height: 2;
    letter-spacing: 0.12em;
}

.auth-panel {
    position: relative;
    width: 100%;
    padding: 42px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 42px 120px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(34px);
}

.auth-panel::before {
    content: "";
    position: absolute;
    left: 42px;
    right: 42px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.78), transparent);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.panel-title {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0.18em;
}

.panel-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    letter-spacing: 0.08em;
}

.panel-code {
    color: var(--gold);
    font: 900 12px "Cinzel", serif;
    letter-spacing: 0.24em;
    white-space: nowrap;
}

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

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

.field label {
    color: rgba(244, 240, 228, 0.72);
    font-size: 13px;
    letter-spacing: 0.18em;
}

.field input {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: none;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font: 600 15px "Noto Serif SC", serif;
    letter-spacing: 0.06em;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.field input:focus {
    border-color: rgba(212, 175, 55, 0.78);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

.field input[readonly] {
    color: rgba(244, 240, 228, 0.72);
}

.primary-btn,
.secondary-btn {
    height: 58px;
    border: 0;
    cursor: pointer;
    font: 900 14px "Noto Serif SC", serif;
    letter-spacing: 0.28em;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.primary-btn {
    margin-top: 8px;
    background: var(--gold);
    color: #060604;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
    cursor: not-allowed;
    transform: none;
    opacity: 0.58;
}

.secondary-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.form-foot {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
    letter-spacing: 0.08em;
}

.form-foot a {
    color: var(--gold);
}

.status {
    min-height: 28px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    letter-spacing: 0.08em;
}

.status.ok { color: #9fe4a7; }
.status.error { color: #ffb1a7; }

.wallet-grid {
    display: grid;
    gap: 14px;
}

.wallet-card {
    min-height: 78px;
    width: 100%;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.wallet-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.62);
    background: rgba(212, 175, 55, 0.055);
}

.wallet-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--gold);
    font: 900 18px "Cinzel", serif;
}

.wallet-name {
    display: block;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.wallet-desc {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.wallet-state {
    color: rgba(244, 240, 228, 0.42);
    font: 900 11px "Cinzel", serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.session-box {
    display: none;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(159, 228, 167, 0.25);
    background: rgba(159, 228, 167, 0.06);
    color: #c7f0cc;
    font-size: 13px;
    line-height: 1.8;
    word-break: break-all;
}

.session-box.show {
    display: block;
}

@media (max-width: 980px) {
    .auth-shell {
        padding: 30px 24px 44px;
        gap: 34px;
    }

    .auth-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-nav {
        flex-wrap: wrap;
        gap: 18px;
        font-size: 13px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .auth-copy {
        padding-bottom: 0;
    }

    .auth-title {
        font-size: clamp(2.7rem, 14vw, 4.8rem);
    }

    .auth-panel {
        padding: 30px 22px;
    }

    .brand-name {
        font-size: 18px;
    }
}
