:root {
    color-scheme: dark;
    font-family: Georgia, 'Times New Roman', serif;
    background: #070706;
    color: #eadfc8;
}

* {
    box-sizing: border-box;
}

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

body.auth-page {
    min-height: 100vh;
    background:
        linear-gradient(rgba(4, 4, 4, 0.10), rgba(4, 4, 4, 0.22)),
        url('../images/auth/frontier-auth-background.webp') center center / cover fixed no-repeat,
        #070706;
}

a {
    color: #d9b46b;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #e4b85c;
    outline-offset: 3px;
}

.auth-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(16px, 2vh, 24px) 0 12px;
}

.auth-brand {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.auth-brand-link {
    display: block;
    width: min(650px, 58vw);
}

.auth-brand-logo {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.78));
}

.auth-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: -2px 0 0;
    color: #e0bb72;
    font-size: clamp(0.74rem, 1vw, 0.98rem);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: center;
    text-shadow: 0 2px 4px #000;
    text-transform: uppercase;
}

.auth-tagline span {
    color: #c18b39;
    font-size: 0.72em;
}

.auth-stage {
    display: grid;
    align-content: center;
    justify-items: center;
    width: 100%;
    padding: 10px 0 12px;
}

.auth-panel,
.auth-notice {
    width: min(560px, 100%);
}

.auth-panel {
    position: relative;
    padding: 24px 34px 27px;
    border: 1px solid #8f662f;
    border-radius: 5px;
    background:
        linear-gradient(rgba(8, 8, 7, 0.94), rgba(8, 8, 7, 0.97)),
        repeating-linear-gradient(0deg, #21170f 0, #21170f 3px, #17100b 4px, #17100b 7px);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.72),
        inset 0 0 0 3px #080705,
        inset 0 0 0 4px rgba(177, 127, 56, 0.42);
}

.auth-panel::before,
.auth-panel::after {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid #b2823e;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e0b65f, #634018 62%, #120d08 68%);
    content: '';
    box-shadow: 0 0 0 2px #090705;
}

.auth-panel::before {
    top: 9px;
    left: 9px;
}

.auth-panel::after {
    right: 9px;
    bottom: 9px;
}

.auth-panel-heading {
    display: grid;
    justify-items: center;
    margin-bottom: 18px;
}

.auth-panel-heading h1 {
    margin: 0;
    color: #edca83;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1;
    letter-spacing: 0.035em;
    text-align: center;
    text-shadow: 0 2px 3px #000;
    text-transform: uppercase;
}

.auth-heading-star {
    display: flex;
    align-items: center;
    width: min(280px, 72%);
    margin-top: 8px;
    color: #d3a04b;
    font-size: 0.82rem;
    gap: 10px;
}

.auth-heading-star::before,
.auth-heading-star::after {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, #8f662e);
    content: '';
}

.auth-heading-star::after {
    background: linear-gradient(90deg, #8f662e, transparent);
}

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

.auth-field {
    display: grid;
    gap: 6px;
}

.auth-field label {
    color: #e2bd77;
    font-family: Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #705735;
    border-radius: 3px;
    background: rgba(7, 8, 8, 0.93);
    box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.88);
    color: #f2e6d0;
    font: 1rem Arial, sans-serif;
}

.auth-field input:hover {
    border-color: #957142;
}

.auth-field input:focus {
    border-color: #d0a154;
}

.auth-field-help {
    margin: 0;
    color: #958875;
    font: 0.75rem/1.35 Arial, sans-serif;
}

.auth-recovery-slot {
    display: flex;
    justify-content: flex-end;
    min-height: 18px;
}

.auth-recovery-link {
    color: #cda45e;
    font: 0.78rem Arial, sans-serif;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-recovery-link:hover {
    color: #efd08f;
}

.auth-primary-button,
.auth-secondary-button {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 48px;
    border-radius: 3px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.auth-primary-button {
    margin: 0;
    border: 1px solid #dcb05d;
    background: linear-gradient(180deg, #e8b955 0%, #ba7a2c 52%, #8f591d 100%);
    box-shadow:
        inset 0 0 0 2px rgba(77, 44, 13, 0.62),
        inset 0 1px 0 rgba(255, 231, 163, 0.58),
        0 5px 14px rgba(0, 0, 0, 0.45);
    color: #180f07;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.08rem;
    cursor: pointer;
}

.auth-primary-button:hover {
    filter: brightness(1.07);
}

.auth-secondary-button {
    border: 1px solid #77582d;
    background: linear-gradient(180deg, rgba(31, 23, 16, 0.98), rgba(10, 9, 7, 0.99));
    color: #e0b66b;
    font-size: 0.95rem;
    box-shadow: inset 0 0 0 1px #090705;
}

.auth-secondary-button:hover {
    border-color: #a47a3e;
    color: #f0cf8f;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 11px;
    margin: 13px 0;
    color: #c0944e;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    background: linear-gradient(90deg, transparent, #6a4e2c);
    content: '';
}

.auth-divider::after {
    background: linear-gradient(90deg, #6a4e2c, transparent);
}

.auth-notice {
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid;
    border-radius: 3px;
    font: 0.86rem/1.4 Arial, sans-serif;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
}

.auth-notice-success {
    border-color: #6f9349;
    background: linear-gradient(180deg, rgba(31, 77, 42, 0.96), rgba(19, 52, 28, 0.96));
    color: #d4eda9;
}

.auth-notice-error {
    border-color: #91463c;
    background: rgba(67, 22, 18, 0.96);
    color: #f0b5aa;
}

.auth-notice strong,
.auth-notice ul {
    margin: 0;
}

.auth-notice ul {
    padding: 5px 0 0 18px;
}

.auth-protection-note {
    margin: 12px 0 0;
    padding: 9px 11px;
    border-left: 3px solid #9f773b;
    background: rgba(7, 7, 6, 0.72);
    color: #a69984;
    font: 0.72rem/1.38 Arial, sans-serif;
}

.auth-protection-note strong {
    color: #d2b178;
}

.auth-panel-register {
    width: min(650px, 100%);
    padding-top: 21px;
    padding-bottom: 22px;
}

.auth-panel-register .auth-form {
    grid-template-columns: 1fr 1fr;
    gap: 9px 12px;
}

.auth-panel-register .auth-field-wide {
    grid-column: 1 / -1;
}

.auth-panel-register .auth-field {
    align-content: start;
}

.auth-panel-register .auth-field input {
    height: 43px;
}

.auth-password-help {
    margin-top: -5px;
}

.auth-panel-register .auth-primary-button {
    margin-top: 2px;
}

.auth-footer {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 0 12px 2px;
    color: #a08f73;
    font: 0.68rem Arial, sans-serif;
    letter-spacing: 0.03em;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 2px 3px #000;
    text-transform: uppercase;
}

.auth-footer-display,
.auth-footer-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}


.auth-footer-display {
    color: #c7b487;
}

.auth-footer-separator {
    color: #9a6b31;
}

.auth-footer-studio {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.auth-footer-studio-logo {
    display: block;
    width: 120px;
    height: auto;
    opacity: 1;
}

@media (max-height: 980px) and (min-width: 760px) {
    .auth-shell {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .auth-brand-link {
        width: min(500px, 44vw);
    }

    .auth-tagline {
        margin-top: -5px;
        font-size: 0.72rem;
    }

    .auth-stage {
        padding: 3px 0 4px;
    }

    .auth-panel {
        padding-top: 17px;
        padding-bottom: 18px;
    }

    .auth-panel-heading {
        margin-bottom: 11px;
    }

    .auth-form {
        gap: 9px;
    }

    .auth-panel-register {
        padding: 13px 30px 14px;
    }

    .auth-panel-register .auth-panel-heading {
        margin-bottom: 8px;
    }

    .auth-panel-register .auth-panel-heading h1 {
        font-size: 2rem;
    }

    .auth-panel-register .auth-heading-star {
        margin-top: 5px;
    }

    .auth-panel-register .auth-form {
        gap: 6px 12px;
    }

    .auth-panel-register .auth-field {
        gap: 3px;
    }

    .auth-panel-register .auth-field label {
        font-size: 0.72rem;
    }

    .auth-panel-register .auth-field input {
        height: 36px;
    }

    .auth-panel-register .auth-field-help {
        font-size: 0.67rem;
        line-height: 1.2;
    }

    .auth-panel-register .auth-primary-button,
    .auth-panel-register .auth-secondary-button {
        min-height: 41px;
    }

    .auth-protection-note {
        margin-top: 7px;
        padding: 6px 9px;
        font-size: 0.67rem;
        line-height: 1.28;
    }

    .auth-panel-register .auth-divider {
        margin: 7px 0;
    }

    .auth-footer {
        padding-bottom: 0;
        font-size: 0.67rem;
    }
}

@media (max-width: 720px) {
    body.auth-page {
        background-attachment: scroll;
        background-position: center center;
    }

    .auth-shell {
        width: min(100% - 22px, 620px);
        padding-top: 12px;
    }

    .auth-brand-link {
        width: min(92vw, 560px);
    }

    .auth-tagline {
        gap: 5px;
        font-size: 0.66rem;
        letter-spacing: 0.045em;
    }

    .auth-panel {
        padding: 21px 19px 23px;
    }

    .auth-panel-register .auth-form {
        grid-template-columns: 1fr;
    }

    .auth-panel-register .auth-field-wide {
        grid-column: auto;
    }

    .auth-footer-display,
    .auth-footer-legal {
        flex-wrap: wrap;
        row-gap: 2px;
    }
}
