/* Herbsway — shared styles */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --green-900: #133D24;
  --green-700: #0F7A3E;
  --green-600: #128A4B;
  --green-100: #E4F0E6;
  --gold-600: #B4842A;
  --gold-700: #93691E;
  --ink: #1B231D;
  --paper: #FBFCF9;
  --card: #FFFFFF;
  --line: #DDE6DE;
  --danger: #A6402F;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url('assets/bg-pattern.png');
  background-repeat: repeat;
  background-size: 420px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 56px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.brand img {
  width: 132px;
  height: auto;
  margin-bottom: 4px;
}

.brand .tagline {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  color: var(--green-900);
  letter-spacing: 0.01em;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(19, 61, 36, 0.04), 0 12px 32px rgba(19, 61, 36, 0.06);
  padding: 28px 26px 30px;
}

.card + .card { margin-top: 16px; }

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 26px;
  color: var(--green-900);
  margin: 0 0 4px;
}

h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--green-900);
  margin: 0 0 14px;
}

p.lede {
  margin: 0 0 22px;
  color: #4B5A4E;
  font-size: 14.5px;
  line-height: 1.5;
}

.step-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 18px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  outline: 2px solid var(--green-600);
  outline-offset: 1px;
  border-color: var(--green-600);
}

.days-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.days-row input[type="number"] { margin-bottom: 0; width: 84px; }
.days-row .days-hint { font-size: 13px; color: #6A7A6D; }

.file-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.file-row:last-child { border-bottom: none; }

.file-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green-600);
  flex-shrink: 0;
}

.file-row { min-height: 44px; }

.file-row .file-name { flex: 1; word-break: break-word; }

.list-tools {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 18px;
}

.list-tools button {
  background: none;
  border: none;
  color: var(--green-700);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.list-tools button:hover { text-decoration: underline; }

button.primary {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--green-600);
  border: none;
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

button.primary:hover { background: var(--green-700); }
button.primary:disabled { background: #A9BBAC; cursor: not-allowed; }

button.secondary {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-100);
  border: none;
  border-radius: 10px;
  padding: 11px;
  cursor: pointer;
}

.status {
  font-size: 13.5px;
  margin-top: 12px;
  min-height: 18px;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--green-700); }

.link-output {
  margin-top: 18px;
  display: none;
}

.link-output.visible { display: block; }

.link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.link-box input {
  margin-bottom: 0;
  font-size: 13px;
  background: var(--green-100);
}

.link-box button {
  flex-shrink: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--gold-600);
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
}

.link-box button:hover { background: var(--gold-700); }

.link-meta {
  font-size: 12.5px;
  color: #6A7A6D;
}

/* Patient page */

.patient-greeting {
  margin-bottom: 22px;
  text-align: center;
}

.patient-greeting .expiry {
  font-size: 13px;
  color: var(--gold-700);
  font-weight: 600;
  margin-top: 6px;
}

.track {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.track:last-child { border-bottom: none; }

.play-btn {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--green-600);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.play-btn:hover { background: var(--green-700); }
.play-btn.playing { background: var(--gold-600); }

.track-info { flex: 1; min-width: 0; }

.track-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-progress {
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.track-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green-600);
  transition: width 0.1s linear;
}

.state-screen {
  text-align: center;
  padding: 20px 6px;
}

.state-screen .icon {
  font-size: 34px;
  margin-bottom: 10px;
}

.state-screen p {
  color: #4B5A4E;
  font-size: 14.5px;
  line-height: 1.5;
}

.footnote {
  margin-top: 22px;
  font-size: 12px;
  color: #8A968C;
  text-align: center;
  max-width: 480px;
}

.selected-count {
  font-size: 13px;
  color: #6A7A6D;
  margin: 6px 2px 10px;
  min-height: 16px;
}

.selected-count.warn {
  color: #9A6A0C;
}

@media (max-width: 480px) {
  .card { padding: 22px 18px 24px; }
  h1 { font-size: 22px; }
  .days-row { flex-wrap: wrap; }
  .link-box { flex-wrap: wrap; }
  .link-box button { width: 100%; padding: 11px 16px; }
}
