:root {
  --blue: #2f69b3;
  --blue-dark: #245792;
  --blue-soft: #e9f1fa;
  --green: #51be9d;
  --ink: #26323d;
  --muted: #697682;
  --line: #d8e0e7;
  --paper: #ffffff;
  --wash: #f4f7f9;
  --error: #aa3434;
  --danger: #a52d2d;
  --radius: 9px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wash);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(47, 105, 179, 0.06), transparent 340px),
    var(--wash);
  font-family: "Spartan", sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(81, 190, 157, 0.55);
  outline-offset: 3px;
}

.site-header {
  color: white;
  background: var(--blue);
}

.header-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 132px;
  margin: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
}

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  width: 170px;
  height: auto;
}

.header-copy {
  display: flex;
  flex-direction: column;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.header-copy strong {
  font-family: "Solway", sans-serif;
  font-size: 24px;
  font-weight: 500;
}

.header-copy span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.office-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.office-nav a,
.text-button {
  color: white;
  background: transparent;
  border: 0;
  padding: 8px 0;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
}

.office-nav a:hover,
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.office-nav form {
  margin: 0;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100vh - 210px);
  margin: 0 auto;
  padding: 64px 0 88px;
}

footer {
  min-height: 78px;
  padding: 22px max(24px, calc((100% - 1120px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: #7f8a93;
  background: #e9eef2;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Solway", sans-serif;
  font-weight: 500;
  line-height: 1.18;
}

h1 {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.025em;
}

.page-heading,
.request-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 52px;
}

.page-heading p,
.request-heading p {
  margin: 0;
  color: var(--muted);
}

.button {
  min-height: 48px;
  padding: 13px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.button:hover {
  background: #3ea987;
  border-color: #3ea987;
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.button.secondary {
  color: var(--blue);
  background: white;
  border-color: var(--blue);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.folder-card {
  position: relative;
  padding-top: 15px;
  text-decoration: none;
}

.folder-tab {
  position: absolute;
  top: 0;
  left: 18px;
  width: 112px;
  height: 27px;
  background: #b8d1ec;
  border-radius: 7px 7px 0 0;
}

.folder-card-body {
  position: relative;
  min-height: 184px;
  padding: 30px;
  background: var(--blue-soft);
  border: 1px solid #ccdae8;
  border-radius: var(--radius);
  transition: border-color 150ms ease, background 150ms ease;
}

.folder-card:hover .folder-card-body {
  background: #e0ebf7;
  border-color: #9fbddd;
}

.folder-card h2 {
  margin-bottom: 22px;
  color: var(--blue-dark);
  font-size: 23px;
}

.folder-card p {
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 600;
}

.folder-card time {
  color: var(--muted);
  font-size: 12px;
}

.base-note {
  margin-top: 40px;
  color: #87919a;
  font-size: 12px;
}

.empty-state {
  padding: 72px 32px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed #bac6d0;
  border-radius: var(--radius);
}

.empty-state.compact {
  padding: 52px 24px;
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--blue);
}

.empty-state p {
  margin-bottom: 24px;
  color: var(--muted);
}

.back-link,
.plain-link {
  color: var(--blue-dark);
  text-underline-offset: 4px;
}

.back-link {
  display: inline-block;
  margin-bottom: 30px;
  text-decoration: none;
}

.back-link:hover,
.plain-link:hover {
  text-decoration: underline;
}

.form-page,
.login-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
}

.form-page p,
.login-panel p {
  color: var(--muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  border: 1px solid #aebbc6;
  border-radius: 5px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(47, 105, 179, 0.15);
}

.stack .button {
  align-self: start;
  margin-top: 12px;
}

.form-error {
  margin: 4px 0 0 !important;
  color: var(--error) !important;
  font-size: 13px;
  font-weight: 600;
}

.login-page .page-shell {
  display: grid;
  place-items: center;
}

.login-panel {
  width: 100%;
}

.created-panel {
  grid-template-columns: auto 1fr;
}

.created-panel .copy-row,
.created-panel .plain-link {
  grid-column: 2;
}

.success-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
}

.copy-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.copy-row input {
  min-width: 0;
}

.copy-row.small {
  width: min(470px, 48vw);
}

.copy-row.small .button {
  white-space: nowrap;
}

.danger-zone {
  margin-top: 64px;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid #ddcaca;
}

.danger-zone h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 20px;
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.danger-button {
  min-height: 44px;
  padding: 10px 18px;
  color: var(--danger);
  background: white;
  border: 1px solid var(--danger);
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  color: white;
  background: var(--danger);
}

.danger-button.solid {
  color: white;
  background: var(--danger);
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.delete-dialog {
  width: min(500px, calc(100% - 30px));
  padding: 0;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.delete-dialog::backdrop {
  background: rgba(20, 30, 40, 0.58);
}

.delete-dialog form {
  padding: 32px;
}

.delete-dialog h2 {
  margin-bottom: 8px;
  color: var(--danger);
  font-size: 25px;
}

.delete-dialog p {
  margin-bottom: 24px;
  color: var(--muted);
}

.delete-dialog label {
  display: block;
  margin-bottom: 7px;
}

.dialog-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.video-card {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  background: #111820;
}

.video-meta {
  padding: 22px;
}

.video-meta h2 {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.video-meta p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.video-meta time {
  color: #87919a;
  font-size: 12px;
}

.year-label {
  display: inline-block;
  margin-right: 9px;
  padding-right: 9px;
  color: var(--blue);
  border-right: 1px solid var(--line);
  font-weight: 600;
}

.public-upload .page-shell {
  width: min(900px, calc(100% - 48px));
}

.upload-intro {
  margin-bottom: 38px;
  text-align: center;
}

.competition-name {
  margin-bottom: 9px;
  color: var(--green);
  font-weight: 700;
}

.upload-intro h1 {
  margin-bottom: 16px;
}

.upload-intro > p:last-child {
  max-width: 620px;
  margin: auto;
  color: var(--muted);
}

.upload-form {
  padding: 40px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field-row {
  max-width: 320px;
  margin-bottom: 24px;
}

.field-row label {
  display: block;
  margin-bottom: 7px;
}

.drop-zone {
  position: relative;
  padding: 62px 28px;
  text-align: center;
  background: #f8fbfd;
  border: 2px dashed #9fb6ca;
  border-radius: var(--radius);
  transition: background 150ms ease, border-color 150ms ease;
}

.drop-zone.is-dragging,
.drop-zone:hover {
  background: #edf5fb;
  border-color: var(--blue);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-size: 28px;
  font-weight: 600;
}

.drop-zone h2 {
  margin-bottom: 5px;
  color: var(--blue-dark);
  font-size: 24px;
}

.drop-zone p {
  margin-bottom: 0;
  color: var(--muted);
}

.drop-zone p span {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drop-zone .file-note {
  margin-top: 18px;
  color: #87919a;
  font-size: 12px;
}

.selected-files {
  margin-top: 18px;
}

.file-list-heading {
  padding: 0 2px 10px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

.file-list-heading span {
  color: var(--muted);
}

.selected-files ul {
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.selected-files li {
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.selected-files li:last-child {
  border-bottom: 0;
}

.selected-files li > span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remove-file {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--danger);
  background: white;
  border: 1px solid #d9b6b6;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.remove-file:hover {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.remove-file:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  margin-top: 24px;
  padding: 20px;
  background: var(--blue-soft);
  border-radius: 5px;
}

.progress-copy {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.progress-copy strong {
  color: var(--blue-dark);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: white;
  border-radius: 2px;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--green);
  transition: width 120ms linear;
}

.upload-progress p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.submit-upload {
  width: 100%;
  margin-top: 24px;
}

.thank-you-page .page-shell {
  display: grid;
  place-items: center;
}

.thank-you {
  max-width: 620px;
  margin: auto;
  padding: 58px;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.thank-you .success-mark {
  margin: 0 auto 22px;
}

.thank-you p {
  color: var(--muted);
}

.error-code {
  margin-bottom: 5px;
  color: var(--green) !important;
  font-weight: 700;
}

@media (max-width: 850px) {
  .header-inner {
    grid-template-columns: auto 1fr;
    min-height: 112px;
  }

  .brand img {
    width: 140px;
  }

  .header-copy strong {
    font-size: 19px;
  }

  .office-nav {
    grid-column: 1 / -1;
    padding: 0 0 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-heading,
  .request-heading {
    align-items: start;
    flex-direction: column;
  }

  .copy-row.small {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .page-shell,
  .public-upload .page-shell {
    width: min(100% - 30px, 1120px);
  }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 0 0;
  }

  .brand img {
    width: 132px;
  }

  .header-copy {
    padding: 0;
    border: 0;
  }

  .office-nav {
    gap: 18px;
    overflow-x: auto;
  }

  .office-nav a,
  .text-button {
    white-space: nowrap;
  }

  .page-shell {
    min-height: calc(100vh - 280px);
    padding: 42px 0 60px;
  }

  h1 {
    font-size: 36px;
  }

  .page-heading {
    margin-bottom: 36px;
  }

  .folder-grid,
  .video-list {
    grid-template-columns: 1fr;
  }

  .folder-card-body {
    min-height: 160px;
  }

  .form-page,
  .login-panel {
    padding: 30px 24px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .created-panel .copy-row,
  .created-panel .plain-link {
    grid-column: 1;
  }

  .copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-button {
    width: 100%;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .upload-form {
    padding: 24px 18px;
  }

  .drop-zone {
    padding: 44px 18px;
  }

  .field-row {
    max-width: none;
  }

  .file-list-heading,
  .selected-files li {
    gap: 12px;
  }

  .thank-you {
    padding: 42px 24px;
  }

  footer {
    flex-direction: column;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
