@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Same palette as the main booksaresocial site. */
  --navy: #2E425A;
  --coral: #FA9583;
  --cream: #F4DFCC;
  --teal: #4097AA;
  --cream-muted: #CFC4B2;

  --bg: var(--cream);
  --text: var(--navy);
  --heading: var(--navy);
  --accent: var(--coral);
  --link: var(--teal);
  --divider: rgba(46, 66, 90, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
  text-align: left;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 8vw 5rem;
}

/* ===================================================
   HEADER - slim, left-aligned, sits on the cream background
   =================================================== */
header.site-header {
  border-bottom: 1px solid var(--divider);
}

header.site-header .header-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.1rem 8vw;
}

header.site-header a {
  color: var(--navy);
  text-decoration: none;
}

header.site-header .site-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

header.site-header nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header.site-header nav a {
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
}

header.site-header nav a:hover,
header.site-header nav a.active {
  border-bottom-color: var(--coral);
}

/* ===================================================
   TYPOGRAPHY & SECTIONS
   =================================================== */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
}

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.3;
  font-weight: 700;
  text-align: left;
}

h1 {
  font-size: 1.9rem;
  margin: 0 0 1.5rem;
}

h1::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 4px;
  background: var(--coral);
  margin-bottom: 1rem;
  border-radius: 2px;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

p, li {
  max-width: 75ch;
  text-align: left;
}

p {
  margin: 0 0 1.25rem;
}

a {
  color: var(--teal);
}

/* A content section, separated from the next by a thin divider instead
   of a card/box. */
.section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--divider);
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section > p:last-child,
.section > ol:last-child,
.section > ul:last-child {
  margin-bottom: 0;
}

/* ===================================================
   STEPS LIST
   =================================================== */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.1rem;
}

.steps li:last-child {
  margin-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--coral);
}

/* ===================================================
   FORMS
   =================================================== */
label {
  display: block;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.4rem;
  margin-top: 2.5rem;
}

label:first-of-type {
  margin-top: 0;
}

.hint {
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--cream-muted);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--text);
  line-height: 1.5;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

input[type="file"] {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.4rem 0;
}

input[type="file"]:focus {
  outline: none;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  margin-right: 1rem;
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--navy);
  color: var(--cream);
}

input[type="file"]:focus::file-selector-button,
input[type="file"]:focus::-webkit-file-upload-button,
input[type="file"]::file-selector-button:focus-visible,
input[type="file"]::-webkit-file-upload-button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

/* Selected-file list shown under a file input's "Choose files" button. */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list:not(:empty) {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--divider);
}

.file-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  font-size: 0.95rem;
  color: var(--text);
}

.file-list .file-name {
  overflow-wrap: anywhere;
}

.file-list .file-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

.file-list .file-remove:hover {
  color: var(--teal);
}

.file-error {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--navy);
}

.file-error:empty {
  display: none;
}

.button, button {
  display: inline-block;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.85rem 1.75rem;
  border-radius: 6px;
  border: none;
  background: var(--coral);
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  margin-top: 1.5rem;
}

.button:hover, button:hover {
  background: var(--teal);
  color: #fff;
}

.error {
  border-left: 3px solid var(--coral);
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

/* ===================================================
   TABLE (history page)
   =================================================== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1.5rem 0.7rem 0;
  border-bottom: 1px solid var(--divider);
}

th:last-child, td:last-child {
  padding-right: 0;
}

td:last-child {
  white-space: nowrap;
}

td:nth-child(2) {
  overflow-wrap: anywhere;
}

th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ===================================================
   LOGIN PAGE
   =================================================== */
body.login-page .page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

/* ===================================================
   PROCESSING SPINNER
   =================================================== */
.spinner {
  border: 6px solid var(--cream-muted);
  border-top-color: var(--coral);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
  margin: 1.5rem 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
