:root {
    --ink: #f7ecd0;
    --muted: #c9b891;
    --panel: #13100f;
    --panel-soft: #201815;
    --wood: #2f1e17;
    --bronze: #b8874b;
    --gold: #dfc477;
    --blue: #36b7dc;
    --blue-dark: #106b88;
    --danger: #ff7777;
    --success: #7fe1a4;
    --display-font: "Cinzel", "Trajan Pro", "Palatino Linotype", Georgia, serif;
    --body-font: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #fff1bd;
    font-family: var(--body-font);
}

body.public-page {
    background:
        linear-gradient(rgba(8, 6, 5, .42), rgba(8, 6, 5, .62)),
        url("../BackgroundImg.png") center / cover fixed no-repeat,
        #1c120e;
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover,
a:focus {
    color: #fff4c5;
}

.site-header,
.site-footer {
    background: linear-gradient(90deg, #20140f, #3a2419 48%, #15100f);
    border-color: rgba(223, 196, 119, .22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 4vw, 56px);
}

.site-header + main {
    display: grid;
    place-items: center;
    padding: clamp(28px, 4vw, 56px) 0;
}

.site-header {
    border-bottom: 1px solid rgba(223, 196, 119, .22);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-footer {
    border-top: 1px solid rgba(223, 196, 119, .22);
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-family: var(--display-font);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .65), 0 0 14px rgba(223, 196, 119, .22);
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--gold);
    background: rgba(16, 107, 136, .5);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 42px;
    place-items: center;
    gap: 5px;
    border: 1px solid rgba(223, 196, 119, .65);
    border-radius: 8px;
    background: rgba(16, 107, 136, .24);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(223, 196, 119, .24);
}

.menu-toggle:hover,
.menu-toggle:focus {
    border-color: var(--blue);
    outline: none;
}

.site-nav,
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--display-font);
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    margin-left: auto;
}

.site-nav a,
.footer-nav a {
    color: var(--muted);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::after {
    content: "▾";
    margin-left: 6px;
    color: var(--gold);
    font-size: .72rem;
}

.nav-dropdown summary:hover,
.nav-dropdown summary:focus {
    color: #fff4c5;
    outline: none;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 18;
    display: grid;
    min-width: 220px;
    padding: 10px;
    border: 1px solid rgba(223, 196, 119, .5);
    border-radius: 12px;
    background: linear-gradient(145deg, #17100e, #2c1c15);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .48);
    transform-origin: top left;
    animation: account-menu-open .16s ease-out both;
}

.nav-dropdown-menu a {
    padding: 9px 10px;
    color: var(--muted);
    white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus {
    background: rgba(54, 183, 220, .14);
    color: #fff4c5;
}

.account-menu {
    position: relative;
}

.account-menu summary {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(223, 196, 119, .65);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 241, 189, .22), transparent 34%),
        rgba(16, 107, 136, .28);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
    cursor: pointer;
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu summary:hover,
.account-menu summary:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(54, 183, 220, .16), 0 8px 20px rgba(0, 0, 0, .32);
    outline: none;
}

.account-icon {
    position: relative;
    width: 22px;
    height: 24px;
}

.account-icon::before,
.account-icon::after {
    position: absolute;
    left: 50%;
    content: "";
    transform: translateX(-50%);
}

.account-icon::before {
    top: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(223, 196, 119, .32);
}

.account-icon::after {
    bottom: 1px;
    width: 20px;
    height: 12px;
    border-radius: 11px 11px 5px 5px;
    background: var(--gold);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 220px;
    padding: 12px;
    border: 1px solid rgba(223, 196, 119, .5);
    border-radius: 12px;
    background: linear-gradient(145deg, #17100e, #2c1c15);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .48);
    transform-origin: top right;
    animation: account-menu-open .16s ease-out both;
}

.account-dropdown p {
    margin: 0 0 8px;
    padding: 8px 10px 10px;
    border-bottom: 1px solid rgba(223, 196, 119, .22);
    color: #fff1bd;
    font-family: var(--display-font);
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.account-dropdown a {
    padding: 9px 10px;
    color: var(--muted);
    font-family: var(--display-font);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.account-dropdown a:hover,
.account-dropdown a:focus {
    background: rgba(54, 183, 220, .14);
    color: #fff4c5;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr);
    width: min(80vw, 1320px);
    min-height: min(760px, calc(100vh - 210px));
    overflow: hidden;
    border: 2px solid rgba(88, 48, 26, .7);
    border-radius: 24px;
    box-shadow:
        0 28px 70px rgba(45, 26, 14, .48),
        0 0 0 1px rgba(255, 255, 255, .18) inset,
        0 0 42px rgba(54, 183, 220, .14);
    animation: panel-arrive .75s ease-out both, panel-glow 5s ease-in-out 1s infinite;
}

.image-panel {
    min-height: 680px;
    background:
        linear-gradient(90deg, rgba(12, 10, 10, .18), rgba(12, 10, 10, .35)),
        url("../LoginPanel.png") center / cover no-repeat;
}

.form-panel {
    display: grid;
    place-items: center;
    padding: clamp(28px, 5vw, 72px);
    background:
        radial-gradient(circle at top right, rgba(54, 183, 220, .13), transparent 32%),
        linear-gradient(135deg, #100d0d, #211713 60%, #0c0a0a);
}

.form-card {
    width: min(100%, 460px);
}

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

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-family: var(--display-font);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .75), 0 0 10px rgba(223, 196, 119, .22);
    text-transform: uppercase;
}

h1 {
    margin: 0 0 24px;
    color: #fff1bd;
    font-family: var(--display-font);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.05;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, .82),
        0 0 18px rgba(223, 196, 119, .26);
    text-transform: uppercase;
}

form {
    display: grid;
    gap: 12px;
}

label {
    color: var(--muted);
    font-family: var(--display-font);
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(223, 196, 119, .32);
    background: rgba(6, 8, 10, .82);
    color: var(--ink);
    font: inherit;
    padding: 0 14px;
    outline: none;
}

input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(54, 183, 220, .18);
}

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

.field-grid > div {
    display: grid;
    gap: 12px;
}

.password-control {
    display: grid;
    grid-template-columns: 1fr 44px 44px;
    align-items: stretch;
}

.password-control input {
    grid-column: 1 / -1;
    padding-right: 94px;
}

.password-control .icon-button {
    margin-left: -44px;
}

.password-control .icon-button:last-child {
    grid-column: 3;
}

.password-control .icon-button:first-of-type {
    grid-column: 2;
}

.icon-button {
    position: relative;
    z-index: 1;
    width: 44px;
    min-height: 46px;
    border: 0;
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    font-size: 1rem;
}

.icon-button:hover,
.icon-button:focus {
    color: var(--blue);
}

.primary-button {
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid rgba(255, 241, 189, .5);
    background: linear-gradient(180deg, #278ab1, #105a77);
    color: #fff8dc;
    cursor: pointer;
    font-family: var(--display-font);
    font-weight: 800;
    letter-spacing: .12em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
    text-transform: uppercase;
}

.primary-button:hover,
.primary-button:focus {
    background: linear-gradient(180deg, #35a8d1, #136a8c);
}

.auth-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    font-family: var(--display-font);
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.alert {
    border: 1px solid;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.alert-error {
    border-color: rgba(255, 119, 119, .45);
    background: rgba(120, 20, 20, .24);
    color: #ffd4d4;
}

.alert-success {
    border-color: rgba(127, 225, 164, .5);
    background: rgba(24, 95, 55, .24);
    color: #dcffe8;
}

.strength-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.strength-track {
    height: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .12);
}

.strength-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--danger);
    transition: width .2s ease, background .2s ease;
}

.strength-label {
    min-width: 92px;
    color: var(--muted);
    font-size: .82rem;
    text-align: right;
}

.password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin: 0 0 4px;
    padding: 0;
    color: var(--muted);
    font-size: .82rem;
    list-style: none;
}

.password-rules li::before {
    content: "•";
    margin-right: 6px;
    color: var(--bronze);
}

.password-rules li.is-met {
    color: var(--success);
}

.password-rules li.is-met::before {
    content: "✓";
    color: var(--success);
}

.simple-page,
.content-panel {
    width: min(80vw, 960px);
    min-height: calc(100vh - 260px);
    color: #20140f;
    border: 2px solid #20140f;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(45, 26, 14, .38);
    padding: clamp(48px, 8vw, 96px);
    background: #fff1bd;
}

.content-panel {
    width: min(80vw, 1320px);
}

.home-page {
    width: min(80vw, 1320px);
    min-height: calc(100vh - 260px);
    color: #20140f;
    border: 2px solid #20140f;
    border-radius: 24px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .42);
    padding: clamp(48px, 7vw, 104px);
    background: #fff1bd;
}

.simple-page h1,
.content-panel h1,
.home-page h1 {
    color: #20140f;
    text-shadow: none;
}

.simple-page .eyebrow,
.content-panel .eyebrow,
.home-page .eyebrow {
    color: #3a2419;
    text-shadow: none;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-heading p:last-child {
    margin: 8px 0 0;
    color: #3a2419;
    font-family: var(--display-font);
    font-weight: 700;
}

.search-panel {
    margin-bottom: 24px;
    border: 2px solid #20140f;
    border-radius: 12px;
    background: rgba(32, 20, 15, .08);
}

.search-panel summary {
    padding: 14px 16px;
    color: #20140f;
    cursor: pointer;
    font-family: var(--display-font);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.search-form {
    padding: 0 16px 16px;
}

.search-form label {
    color: #20140f;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: end;
}

.secondary-button {
    display: inline-grid;
    min-height: 48px;
    place-items: center;
    border: 1px solid #20140f;
    padding: 0 18px;
    color: #20140f;
    font-family: var(--display-font);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.table-wrap {
    overflow-x: auto;
    border: 2px solid #20140f;
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    color: #20140f;
    background: #fff1bd;
}

.data-table th {
    background: #20140f;
    color: #fff1bd;
    font-family: var(--display-font);
    font-size: .86rem;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.data-table th,
.data-table td {
    border: 1px solid #20140f;
    padding: 14px 16px;
}

.data-table td {
    background: #fff1bd;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 24px;
    color: #20140f;
    font-family: var(--display-font);
    font-weight: 700;
}

.pagination a {
    border: 1px solid #20140f;
    padding: 10px 14px;
    color: #20140f;
}

.data-table .table-button {
    display: inline-grid;
    min-height: 40px;
    place-items: center;
    border: 2px solid #20140f;
    border-radius: 8px;
    padding: 0 16px;
    background: #20140f;
    color: #fff1bd;
    font-family: var(--display-font);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    box-shadow: 0 4px 0 rgba(58, 36, 25, .38);
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table .table-button:hover,
.data-table .table-button:focus {
    background: #3a2419;
    color: #fff4c5;
    transform: translateY(-1px);
}

.home-intro {
    max-width: 760px;
    margin: 0;
    color: #20140f;
    font-size: 1.08rem;
    line-height: 1.7;
}

.home-page img {
    border: 1px solid #20140f;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(32, 20, 15, .35);
}

.text-link {
    display: inline-flex;
    margin-top: 12px;
}

.site-footer p {
    margin: 0;
    color: var(--muted);
    font-family: var(--display-font);
    font-size: .88rem;
    letter-spacing: .04em;
}

@keyframes panel-arrive {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes panel-glow {
    0%,
    100% {
        box-shadow:
            0 28px 70px rgba(45, 26, 14, .48),
            0 0 0 1px rgba(255, 255, 255, .18) inset,
            0 0 34px rgba(54, 183, 220, .1);
    }

    50% {
        box-shadow:
            0 30px 76px rgba(45, 26, 14, .56),
            0 0 0 1px rgba(255, 241, 189, .22) inset,
            0 0 54px rgba(54, 183, 220, .24);
    }
}

@keyframes account-menu-open {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        width: 96vw;
    }

    .simple-page,
    .content-panel,
    .home-page {
        width: 96vw;
    }

    .image-panel {
        min-height: 300px;
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
    }

    .menu-toggle {
        display: grid;
    }

    .header-actions {
        align-items: center;
        display: contents;
    }

    .site-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 14px;
    }

    .site-nav.is-open {
        display: grid;
        gap: 12px;
    }

    .site-nav a,
    .nav-dropdown summary {
        display: block;
        width: 100%;
        border: 1px solid rgba(223, 196, 119, .28);
        border-radius: 8px;
        padding: 12px 14px;
        background: rgba(0, 0, 0, .16);
    }

    .account-menu {
        justify-self: end;
    }

    .site-footer {
        display: flex;
    }

    .footer-nav {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .field-grid,
    .password-rules {
        grid-template-columns: 1fr;
    }

    .auth-links {
        align-items: center;
        flex-direction: column;
        gap: 10px;
    }

    .account-dropdown {
        left: auto;
        right: 0;
    }

    .nav-dropdown-menu {
        position: static;
        margin-top: 10px;
    }

    .page-heading,
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

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