/*
  Shared Ortho Training styles
  - Keep this file simple so non-technical contributors can safely edit colors.
  - Used by all pages in /public
*/

:root {
  --navy: #1F3A5F;
  --teal: #4FA3A5;
  --bg: #F7F9FB;
  --text: #2B2B2B;
  --slate: #AAB4BE;
  --page-margin: 0.5in;

  /* Mobile-first spacing tokens */
  --page-pad-x: clamp(12px, 4vw, 18px);
  --page-pad-y: clamp(16px, 4vw, 24px);
  --card-radius: 12px;
}

/* Defensive defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
canvas,
svg,
input,
button,
select,
textarea {
  max-width: 100%;
}

/* Basic layout helpers */
.page {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: calc(var(--page-pad-y) + env(safe-area-inset-top)) var(--page-pad-x)
    calc(var(--page-pad-y) + env(safe-area-inset-bottom));
}

.sheet {
  width: 100%;
  background: #fff;
  border: 1px solid var(--slate);
  border-radius: var(--card-radius);
  box-shadow: 0 2px 6px rgba(31,58,95,0.06);
  padding: clamp(12px, 3.5vw, 16px);
  overflow: hidden; /* prevents tiny subpixel overflow on iOS */
}

/* Buttons */
.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button.action {
  appearance: none;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  line-height: 1.1;
  white-space: normal;
}

button.secondary { background: #fff; color: var(--navy); }

/* Make button rows behave on phones (wrap cleanly, no overflow) */
@media (max-width: 480px) {
  .btns button.action {
    flex: 1 1 auto;
  }
}

/* Forms (collapse any 2-col grids to 1-col on small screens) */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
}

/* Slim bottom next button used on week pages */
.next-wrap { display: flex; justify-content: center; margin: 14px 0 0; }
.next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--slate);
  background: #ffffff;
  color: var(--navy);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 10px rgba(31,58,95,0.08);
  animation: nextBounce 1.6s ease-in-out infinite;
}
.next-btn:hover { border-color: var(--teal); box-shadow: 0 2px 14px rgba(79,163,165,0.18); }
@keyframes nextBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@media print {
  @page { size: letter; margin: var(--page-margin); }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .next-wrap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
