:root {
    --auth-ink: #3f372f;
    --auth-muted: #6f675f;
    --auth-accent: #627987;
    --auth-accent-deep: #4f6572;
    --auth-teal: #126b5f;
    --auth-line: rgba(126, 119, 109, 0.16);
    --auth-surface: rgba(255, 251, 245, 0.94);
    --auth-surface-strong: #f8f2e8;
    --auth-tint: #e7eef2;
    --auth-page-top: #d8e0e6;
    --auth-page-bottom: #f4ede2;
    --auth-error-bg: #f4ebe3;
    --auth-error-line: #d5b7a3;
    --auth-error-text: #7b5b48;
    --auth-success-bg: #eef4ea;
    --auth-success-line: #bfd0b5;
    --auth-success-text: #496146;
    --auth-shadow: 0 24px 60px rgba(40, 35, 29, 0.12);
}

html,
body {
    min-height: 100%;
}

body.auth-master-body {
    margin: 0;
    font-family: "Segoe UI", system-ui, Arial, Helvetica, sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.85), transparent 30%),
        radial-gradient(circle at 88% 92%, rgba(98, 121, 135, 0.14), transparent 40%),
        linear-gradient(160deg, var(--auth-page-top) 0%, var(--auth-page-bottom) 60%, #f8f2e8 100%);
}

.auth-master-form {
    min-height: 100vh;
    margin: 0;
}

.auth-master-shell {
    width: min(1240px, calc(100% - 24px));
    margin: 20px auto;
    border: 1px solid var(--auth-line);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 253, 249, 0.82);
    box-shadow: var(--auth-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.auth-master-form--bare {
    display: grid;
    place-items: center;
    padding: 24px 12px;
}

.auth-master-shell--bare {
    width: min(1060px, 100%);
    margin: 0 auto;
    background: rgba(255, 253, 249, 0.9);
}

.auth-master-shell--bare .auth-body-grid {
    padding: 0;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(255, 251, 245, 0.88);
    border-bottom: 1px solid rgba(126, 119, 109, 0.12);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.auth-brand-logo-wrap {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    border: 1px solid rgba(126, 119, 109, 0.18);
    background: linear-gradient(180deg, #ffffff, #f1e8dc);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-brand-logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.auth-brand-kicker {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--auth-accent-deep);
    font-weight: 700;
}

.auth-brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--auth-ink);
}

.auth-topnav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.auth-mobile-menu-toggle {
    display: none;
}

.auth-help-menu {
    position: relative;
    margin: 0;
}

.auth-help-menu summary {
    list-style: none;
}

.auth-help-menu summary::-webkit-details-marker {
    display: none;
}

.auth-help-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--auth-accent-deep);
    font-weight: 600;
    cursor: pointer;
}

.auth-help-menu-toggle:hover,
.auth-help-menu-toggle:focus {
    text-decoration: underline;
}

.auth-help-chevron {
    font-size: 0.78rem;
    transition: transform 160ms ease;
}

.auth-help-menu[open] .auth-help-chevron {
    transform: rotate(180deg);
}

.auth-help-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 0.12rem;
    min-width: 250px;
    padding: 0.45rem;
    border: 1px solid rgba(126, 119, 109, 0.14);
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 18px 42px rgba(24, 38, 53, 0.14);
}

.auth-help-dropdown-link,
.auth-help-dropdown-link:visited {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.48rem 0.75rem;
    border-radius: 14px;
    color: var(--auth-ink);
    font-weight: 600;
    text-decoration: none;
}

.auth-help-dropdown-link:hover,
.auth-help-dropdown-link:focus {
    background: rgba(231, 238, 242, 0.72);
    color: var(--auth-ink);
    text-decoration: none;
}

.auth-help-dropdown-separator {
    height: 1px;
    margin: 0.3rem 0.45rem;
    background: rgba(126, 119, 109, 0.16);
}

.auth-help-dropdown-link--support {
    color: var(--auth-accent-deep) !important;
}

.auth-topnav-link,
.auth-footer-links a,
.auth-support-link {
    color: var(--auth-accent-deep);
    font-weight: 600;
    text-decoration: none;
}

.auth-topnav-link:hover,
.auth-footer-links a:hover,
.auth-support-link:hover {
    color: var(--auth-accent-deep);
    text-decoration: underline;
}

.auth-topnav-link--active,
.auth-topnav-link--active:visited {
    color: #214f48;
    text-decoration: underline;
    text-decoration-color: #126b5f;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.32rem;
}

.auth-topnav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(98, 121, 135, 0.22);
    background: rgba(231, 238, 242, 0.9);
    color: var(--auth-ink);
    font-weight: 700;
    text-decoration: none;
}

.auth-topnav-button:hover {
    text-decoration: none;
    color: var(--auth-ink);
    background: rgba(220, 231, 237, 0.96);
}

.auth-user-menu {
    position: relative;
    margin: 0;
}

.auth-user-menu summary {
    list-style: none;
}

.auth-user-menu summary::-webkit-details-marker {
    display: none;
}

.auth-user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 48px;
    padding: 0.45rem 0.7rem 0.45rem 0.45rem;
    border: 1px solid rgba(98, 121, 135, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    cursor: pointer;
}

.auth-user-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f7efe3, #ebf0f3);
    border: 1px solid rgba(126, 119, 109, 0.18);
}

.auth-user-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-user-meta {
    display: grid;
    min-width: 0;
}

.auth-user-name {
    color: var(--auth-ink);
    font-weight: 700;
    white-space: nowrap;
}

.auth-user-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.45rem;
    margin-top: 0.12rem;
    padding: 0.08rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.auth-user-badge--active {
    background: rgba(73, 97, 70, 0.12);
    color: var(--auth-success-text);
    border: 1px solid rgba(73, 97, 70, 0.16);
}

.auth-user-badge--inactive {
    background: rgba(123, 91, 72, 0.08);
    color: var(--auth-error-text);
    border: 1px solid rgba(123, 91, 72, 0.12);
}

.auth-user-chevron {
    color: var(--auth-accent-deep);
    font-size: 1rem;
}

.auth-user-menu[open] .auth-user-chevron {
    transform: rotate(180deg);
}

.auth-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 0.45rem;
    border-radius: 18px;
    border: 1px solid rgba(126, 119, 109, 0.14);
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 18px 42px rgba(24, 38, 53, 0.14);
    display: grid;
    gap: 0.12rem;
    z-index: 10;
}

.auth-user-dropdown-link,
.auth-user-dropdown-link:visited {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--auth-ink);
    text-decoration: none;
    font-weight: 600;
    text-align: left;
}

.auth-user-dropdown-link:hover,
.auth-user-dropdown-link:focus {
    background: rgba(231, 238, 242, 0.72);
    color: var(--auth-ink);
    text-decoration: none;
}

.auth-user-dropdown-link--logout {
    color: #7b5b48;
}

.auth-user-dropdown-meta {
    min-width: 0;
    margin-top: 0.12rem;
    padding: 0.65rem 0.75rem 0.2rem;
    border-top: 1px solid rgba(126, 119, 109, 0.14);
    color: var(--auth-ink);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-body-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 24px;
    padding: 28px;
}

.auth-body-grid--main-only {
    grid-template-columns: minmax(0, 1fr);
}

.auth-news-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.auth-news-column--hidden {
    display: none;
}

.auth-news-card,
.auth-support-card {
    padding: 24px;
    border-radius: 30px;
    background: var(--auth-surface);
    border: 1px solid rgba(126, 119, 109, 0.14);
    box-shadow: 0 16px 36px rgba(45, 41, 36, 0.09);
}

.auth-card-kicker {
    margin-bottom: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--auth-accent-deep);
    font-weight: 700;
}

.auth-card-title,
.auth-support-title {
    margin: 0 0 10px;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.auth-news-copy,
.auth-news-copy p,
.auth-support-copy {
    color: var(--auth-muted);
    line-height: 1.7;
}

.auth-news-copy p:last-child {
    margin-bottom: 0;
}

.auth-support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 16px;
}

.auth-main-column {
    min-width: 0;
}

.auth-main-column--full {
    width: 100%;
}

.auth-footer {
    padding: 16px 28px 22px;
    border-top: 1px solid rgba(126, 119, 109, 0.12);
    background: rgba(255, 251, 245, 0.84);
}

.auth-footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.auth-footer-note {
    color: var(--auth-muted);
    margin-top: 10px;
    font-size: 0.92rem;
}

.auth-footer-meta {
    display: inline-block;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(126, 119, 109, 0.22);
    color: var(--auth-ink);
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .auth-master-shell {
        width: min(100%, calc(100% - 12px));
        margin: 6px auto;
        border-radius: 24px;
    }

    .auth-body-grid {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .auth-topbar,
    .auth-footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 767.98px) {
    .auth-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
    }

    .auth-mobile-menu-toggle {
        display: inline-grid;
        align-content: center;
        justify-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(98, 121, 135, 0.24);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.84);
        color: var(--auth-ink);
        cursor: pointer;
    }

    .auth-mobile-menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 160ms ease, opacity 160ms ease;
    }

    .auth-mobile-menu-toggle--open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .auth-mobile-menu-toggle--open span:nth-child(2) {
        opacity: 0;
    }

    .auth-mobile-menu-toggle--open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .auth-topnav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid rgba(126, 119, 109, 0.14);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .auth-topnav--open {
        display: flex;
    }

    .auth-topnav-link,
    .auth-topnav-link:visited {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
    }

    .auth-topnav-link--active,
    .auth-topnav-link--active:visited {
        padding-bottom: 0.65rem;
        border-bottom: 0;
        background: rgba(18, 107, 95, 0.09);
    }

    .auth-help-menu,
    .auth-help-menu-toggle {
        width: 100%;
        box-sizing: border-box;
    }

    .auth-help-menu-toggle {
        justify-content: space-between;
        min-height: 44px;
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
    }

    .auth-help-menu[open] .auth-help-menu-toggle {
        background: rgba(231, 238, 242, 0.72);
    }

    .auth-help-dropdown {
        position: static;
        min-width: 0;
        margin-top: 4px;
        border-radius: 14px;
        box-shadow: none;
    }

    .auth-user-menu,
    .auth-user-menu-toggle {
        width: 100%;
        box-sizing: border-box;
    }

    .auth-user-menu-toggle {
        border-radius: 14px;
    }

    .auth-user-dropdown {
        position: static;
        min-width: 0;
        margin-top: 8px;
        border-radius: 14px;
        box-shadow: none;
    }

    .auth-news-card,
    .auth-support-card {
        padding: 20px;
        border-radius: 22px;
    }

    .auth-footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .auth-footer-meta {
        display: block;
        margin-top: 0.5rem;
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
}