*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #05070b;
    color: #fff;
}

body {
    min-height: 100dvh;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.45;
}

a,
a:link,
a:visited {
    color: #fff;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: none;
}

.site-header__mark {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.site-nav {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem 1.1rem;
    font-size: 0.95rem;
}

.site-nav a,
.site-nav a:link,
.site-nav a:visited {
    color: #fff;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    text-decoration: underline;
}

.site-nav__account {
    position: relative;
}

.site-nav__account-toggle {
    list-style: none;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.42);
}

.site-nav__account-toggle::marker {
    content: none;
}

.site-nav__account-toggle::-webkit-details-marker {
    display: none;
}

.site-nav__account-toggle::after {
    content: "";
    display: inline-block;
    width: 0.35em;
    height: 0.35em;
    margin-left: 0.4em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-0.1em) rotate(45deg);
    vertical-align: middle;
}

.site-nav__account[open] > .site-nav__account-toggle,
.site-nav__account-toggle:hover,
.site-nav__account-toggle:focus-visible {
    border-bottom-style: solid;
    border-bottom-color: #fff;
}

.site-nav__account[open] > .site-nav__account-toggle::after {
    transform: translateY(0.1em) rotate(225deg);
}

.site-nav__account-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 20;
    min-width: 10rem;
    padding: 0.4rem 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.5rem;
    background: rgba(12, 16, 24, 0.94);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.site-nav__logout {
    display: block;
    margin: 0;
}

.site-nav__account-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.85rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.site-nav__account-menu a.site-nav__account-item,
.site-nav__account-menu a.site-nav__account-item:link,
.site-nav__account-menu a.site-nav__account-item:visited {
    color: inherit;
    text-decoration: none;
}

.site-nav__logout button {
    display: block;
    width: 100%;
}

.site-nav__account-item:hover,
.site-nav__account-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

body.page-home {
    background-color: #05070b;
    background-image: url("/images/background.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

body.page-home main {
    min-height: 100dvh;
}

.lock-clock {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #fff;
    font-size: 0.95rem;
}

.lock-clock__date,
.lock-clock__time {
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.lock-clock__date {
    overflow: hidden;
    text-overflow: ellipsis;
}

.lock-clock__time {
    flex-shrink: 0;
}

body.page-auth main {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5.5rem 1.25rem 2rem;
}

.auth-card {
    width: min(100%, 24rem);
}

.auth-card h1 {
    margin: 0 0 0.75rem;
    font-size: 1.6rem;
    font-weight: 650;
}

.auth-card p {
    margin: 0 0 1.15rem;
    color: rgba(255, 255, 255, 0.82);
}

.auth-flash {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #3f3f46;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.auth-flash--error {
    border-color: #7f1d1d;
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
}

.auth-flash--ok {
    border-color: #14532d;
    background: rgba(20, 83, 45, 0.35);
    color: #bbf7d0;
}

.auth-form {
    display: grid;
    gap: 0.45rem;
}

.auth-form__label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.78);
}

.auth-form__optional {
    color: rgba(255, 255, 255, 0.5);
}

.auth-form__input {
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 1px solid #3f3f46;
    border-radius: 0.5rem;
    background: #11141c;
    color: #fff;
    font: inherit;
}

.auth-form__input:focus {
    outline: none;
    border-color: #a1a1aa;
    box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.25);
}

.auth-form__button {
    margin-top: 0.55rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.5rem;
    background: #f4f4f5;
    color: #05070b;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.auth-form__button:hover,
.auth-form__button:focus-visible {
    background: #fff;
}

.auth-card p.auth-switch {
    /* Match the email-field-to-button gap (grid 0.45rem + button 0.55rem). */
    margin: 1rem 0 0;
}

.auth-switch a,
.auth-switch a:link,
.auth-switch a:visited {
    color: #fff;
}

body.page-profile main {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 5.5rem 1.25rem 2.5rem;
}

.profile {
    width: min(100%, 40rem);
}

.profile h1 {
    margin: 0 0 0.5rem;
    font-size: 1.7rem;
    font-weight: 650;
}

.profile__lede,
.profile-section > p,
.profile-hint,
.profile-empty {
    color: rgba(255, 255, 255, 0.78);
}

.profile__lede {
    margin: 0 0 1.4rem;
}

.profile-section {
    margin: 0 0 1.5rem;
    padding: 1.15rem 1.15rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.85rem;
    background: rgba(12, 16, 24, 0.72);
}

.profile-section h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 650;
}

.profile-section > p {
    margin: 0 0 1rem;
    font-size: 0.92rem;
}

.profile-hint,
.profile-empty {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.profile-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.85rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.profile-photos__item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #3f3f46;
    border-radius: 0.75rem;
    background: #11141c;
}

.profile-photos__item.is-active {
    border-color: #f4f4f5;
    box-shadow: 0 0 0 2px rgba(244, 244, 245, 0.28);
}

.profile-photos__item img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #05070b;
}

.profile-photos__badge {
    margin: 0;
    padding: 0.35rem 0.55rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e4e4e7;
}

.profile-photos__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem;
}

.profile-photos__actions form {
    margin: 0;
}

.profile-photos__add {
    display: flex;
    min-height: 0;
}

.profile-photos__add[hidden] {
    display: none;
}

.profile-photos__upload {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    margin: 0;
}

.profile-photos__file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-photos__drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    aspect-ratio: 3 / 4;
    padding: 0.85rem;
    border: 1px dashed #52525b;
    border-radius: 0.75rem;
    background: #11141c;
    color: #e4e4e7;
    text-align: center;
    cursor: pointer;
}

.profile-photos__drop:hover,
.profile-photos__drop:focus-visible,
.profile-photos__file:focus-visible + .profile-photos__drop,
.profile-photos__drop.is-dragover {
    border-color: #f4f4f5;
    box-shadow: 0 0 0 2px rgba(244, 244, 245, 0.28);
}

.profile-photos__drop.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.profile-photos__drop-title {
    font-size: 0.95rem;
    font-weight: 650;
}

.profile-photos__drop-hint {
    font-size: 0.75rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.68);
}

.profile-button {
    padding: 0.4rem 0.65rem;
    border: 1px solid #3f3f46;
    border-radius: 0.45rem;
    background: #1a1d27;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.profile-button:hover,
.profile-button:focus-visible {
    border-color: #a1a1aa;
}

.profile-button--danger {
    border-color: #7f1d1d;
    background: transparent;
    color: #fecaca;
}

.profile-button--danger:hover,
.profile-button--danger:focus-visible {
    border-color: #fecaca;
}

.profile-topics {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
}

.profile-topics[hidden] {
    display: none;
}

.profile-topics__item {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid #3f3f46;
    border-radius: 0.65rem;
    background: #11141c;
}

.profile-topics__edit .auth-form__button {
    justify-self: start;
}

.profile-topics__delete {
    margin: 0;
}

.profile-topics__status {
    margin: 0.35rem 0 0;
}

input[type="file"].auth-form__input {
    padding: 0.45rem;
}
