@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-deep: #071826;
    --bg-sea: #0d3a4f;
    --paper: #f4f9ff;
    --paper-strong: #ffffff;
    --ink: #102235;
    --ink-soft: #4f6576;
    --accent: #ff6b4a;
    --accent-dark: #d85034;
    --highlight: #f9c74f;
    --success: #1c9b6f;
    --danger: #cf2f3d;
    --line: rgba(255, 255, 255, 0.38);
    --card-shadow: 0 18px 45px rgba(2, 12, 21, 0.28);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 141, 103, 0.26), transparent 35%),
        radial-gradient(circle at 85% 12%, rgba(104, 211, 247, 0.22), transparent 40%),
        linear-gradient(130deg, var(--bg-deep), var(--bg-sea));
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    border-radius: 999px;
    z-index: 0;
    filter: blur(45px);
    pointer-events: none;
}

body::before {
    width: min(45vw, 480px);
    height: min(45vw, 480px);
    background: rgba(255, 217, 102, 0.16);
    top: -10vw;
    right: -12vw;
    animation: drift 16s ease-in-out infinite;
}

body::after {
    width: min(48vw, 520px);
    height: min(48vw, 520px);
    background: rgba(0, 191, 166, 0.15);
    left: -14vw;
    bottom: -16vw;
    animation: drift 14s ease-in-out infinite reverse;
}

.signup-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 42px);
    position: relative;
    z-index: 1;
}

.signup-card {
    width: min(560px, 100%);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--card-shadow);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(227, 240, 252, 0.84));
    backdrop-filter: blur(8px);
    padding: clamp(20px, 4vw, 34px);
    animation: card-in 0.72s ease both;
}

.signup-card h1,
.dashboard-shell h1 {
    font-family: 'Fraunces', serif;
    letter-spacing: 0.02em;
}

.brand-logo {
    width: clamp(120px, 24vw, 190px);
    display: block;
    margin: 0 auto 14px;
}

.signup-card h1 {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: #0f2d41;
}

.lead {
    margin: 8px auto 22px;
    max-width: 46ch;
    text-align: center;
    color: var(--ink-soft);
    font-size: 1rem;
}

.signup-form {
    display: grid;
    gap: 11px;
}

.signup-form label {
    color: #17384f;
    font-weight: 600;
    font-size: 0.95rem;
}

.field-input,
.search-input {
    width: 100%;
    border-radius: 13px;
    border: 1px solid rgba(16, 34, 53, 0.2);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    padding: 12px 14px;
    font-size: 0.98rem;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.field-input:focus,
.search-input:focus {
    outline: none;
    border-color: rgba(255, 107, 74, 0.75);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.2);
    background: #ffffff;
}

.primary-btn,
.secondary-btn {
    border-radius: 13px;
    border: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent), #ff885f);
    color: #fff;
    width: 100%;
    min-height: 48px;
    box-shadow: 0 10px 20px rgba(208, 80, 52, 0.3);
}

.primary-btn:hover,
.primary-btn:focus-visible {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--accent-dark), #f87349);
}

.primary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.66);
    color: #16374f;
    border: 1px solid rgba(18, 51, 74, 0.25);
    min-height: 44px;
    padding: 10px 16px;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
}

.actions {
    margin-top: 14px;
}

.staff-access {
    margin-top: 14px;
    text-align: right;
}

.staff-access a {
    font-size: 0.82rem;
    color: rgba(18, 51, 74, 0.72);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.2s ease, opacity 0.2s ease;
    opacity: 0.86;
}

.staff-access a:hover,
.staff-access a:focus-visible {
    color: rgba(18, 51, 74, 0.96);
    text-decoration: underline;
    opacity: 1;
}

.alert-container {
    min-height: 54px;
    margin-bottom: 8px;
}

.alert {
    border-radius: 13px;
    padding: 12px 14px;
    font-weight: 600;
    border: 1px solid transparent;
    animation: rise 0.35s ease;
}

.alert-success {
    color: #0f5f45;
    background: rgba(49, 214, 158, 0.2);
    border-color: rgba(28, 155, 111, 0.35);
}

.alert-error {
    color: #8f1f2a;
    background: rgba(226, 92, 102, 0.18);
    border-color: rgba(207, 47, 61, 0.4);
}

.snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.snowflake {
    position: fixed;
    top: -10vh;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    animation: snow-fall var(--duration) linear infinite;
    animation-delay: var(--delay);
    opacity: var(--opacity);
}

.dashboard-page {
    padding: clamp(18px, 4vw, 42px);
}

.dashboard-shell {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-header h1 {
    color: #eaf5ff;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.1;
}

.dashboard-header .subhead {
    color: rgba(226, 241, 255, 0.88);
    margin-top: 6px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: rgba(236, 245, 253, 0.9);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.46);
    box-shadow: 0 8px 22px rgba(3, 20, 31, 0.15);
}

.stat-card h2 {
    font-size: 0.95rem;
    color: #355069;
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 1.15rem;
    color: #102235;
    font-weight: 700;
}

.table-panel {
    background: rgba(241, 248, 255, 0.9);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.44);
    box-shadow: 0 14px 32px rgba(2, 12, 21, 0.21);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 13px;
    border-bottom: 1px solid rgba(6, 23, 33, 0.1);
}

.search-label {
    color: #21425c;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-input {
    width: min(340px, 100%);
    padding: 10px 12px;
}

.result-count {
    margin-left: auto;
    color: #3b5a75;
    font-weight: 600;
    font-size: 0.9rem;
}

.table-wrap {
    overflow: auto;
}

#queueTable {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

#queueTable th,
#queueTable td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(12, 31, 44, 0.08);
}

#queueTable thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #12334a;
    color: #e9f2fb;
}

.sort-trigger {
    font: inherit;
    color: inherit;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sort-trigger::after {
    content: '↕';
    font-size: 0.72rem;
    opacity: 0.55;
}

.sort-trigger[data-direction='asc']::after {
    content: '↑';
    opacity: 1;
}

.sort-trigger[data-direction='desc']::after {
    content: '↓';
    opacity: 1;
}

#queueTable tbody tr {
    transition: background-color 0.16s ease;
}

#queueTable tbody tr:nth-child(even) {
    background: rgba(228, 237, 246, 0.35);
}

#queueTable tbody tr:hover {
    background: rgba(241, 196, 78, 0.18);
}

#queueTable a {
    color: #0b5f8b;
    font-weight: 600;
    text-decoration: none;
}

#queueTable a:hover {
    text-decoration: underline;
}

.upload-cell {
    min-width: 260px;
}

.photo-upload-form {
    display: grid;
    gap: 6px;
}

.upload-label {
    font-size: 0.78rem;
    color: #355069;
    font-weight: 600;
}

.upload-input {
    font: inherit;
    font-size: 0.82rem;
    color: #17384f;
}

.upload-btn {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.upload-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none;
}

.upload-status {
    min-height: 1.1rem;
    margin: 0;
    font-size: 0.78rem;
    color: #3b5a75;
}

.upload-status.is-pending {
    color: #1e4f86;
}

.upload-status.is-success {
    color: #0f5f45;
}

.upload-status.is-error {
    color: #8f1f2a;
}

.sent-photos {
    border-top: 1px dashed rgba(18, 51, 74, 0.2);
    padding-top: 6px;
}

.sent-photos-title {
    margin: 0;
    font-size: 0.72rem;
    color: #355069;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sent-photo-list {
    margin: 6px 0 0;
    padding-left: 16px;
    max-height: 94px;
    overflow: auto;
}

.sent-photo-list li {
    color: #21425c;
    font-size: 0.76rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.sent-photo-empty {
    margin: 5px 0 0;
    font-size: 0.76rem;
    color: #6a7f92;
}

@keyframes snow-fall {
    0% {
        transform: translate3d(0, -10vh, 0) rotate(0deg);
    }

    100% {
        transform: translate3d(var(--drift), 115vh, 0) rotate(360deg);
    }
}

@keyframes drift {
    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(16px, -10px);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .signup-card {
        border-radius: 20px;
        padding: 20px;
    }

    .dashboard-page {
        padding: 14px;
    }

    .table-toolbar {
        align-items: stretch;
    }

    .result-count {
        margin-left: 0;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .secondary-btn,
    .header-actions .primary-btn {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
