/* Schools Plus Clock-In · prototype styles
 * Mobile-first. Single column. No web fonts. WCAG AA contrast.
 * Brand colour placeholder: --brand. Swap when stakeholder confirms. */

:root {
  --brand: #1e6fd9;
  --brand-dark: #144a91;
  --success: #21a05a;
  --warning: #f0a72b;
  --danger: #b3261e;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --border: #d8dde5;
  --radius: 14px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 48px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* User-agent default for [hidden] is display:none, but .screen { display: flex }
 * has higher specificity and would otherwise show every state at once. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main#app {
  flex: 1;
  display: block;
  padding: var(--space-md);
  width: 100%;
}

.screen {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: stretch;
}

h1, h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

h2 { font-size: 1.4rem; }

.lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

/* Form fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-text {
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  font-size: 1.1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 3px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.counter {
  align-self: flex-end;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.counter.near-limit { color: var(--warning); }
.counter.at-limit { color: var(--danger); font-weight: 600; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  width: 100%;
  padding: 14px 20px;
  font-size: 1.15rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 120ms ease, transform 80ms ease;
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-action {
  font-size: 1.4rem;
  min-height: 80px;
  margin: var(--space-sm) 0;
}

.btn:focus-visible {
  outline: 3px solid var(--brand-dark);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Link-styled buttons */

.link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  padding: 12px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
}

.link:hover, .link:focus { color: var(--brand-dark); }
.link-muted { color: var(--text-muted); }
.link-muted:hover, .link-muted:focus { color: var(--text); }

.link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

/* Error & info messages */

.error {
  margin: 0;
  padding: 12px 14px;
  background: #fdecea;
  border-left: 4px solid var(--danger);
  color: #6e1612;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Icons & spinner */

.icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border: 5px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 3px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 6px 0 0;
}

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

/* Syncing badge — visually distinct from full success */

.syncing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff8e6;
  border: 1.5px solid var(--warning);
  border-radius: var(--radius);
  color: #6b4a06;
  font-size: 0.95rem;
  margin: 0 auto;
}

.queue-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #fff8e6;
  border: 1px solid var(--warning);
  border-radius: 10px;
  color: #6b4a06;
  font-size: 0.9rem;
  align-self: center;
  margin: 0;
}

/* Footer */

footer {
  padding: var(--space-md);
  text-align: center;
}

footer .small { color: var(--text-muted); }
