/* ==========================================================================
   STARBUCKS BASE STYLES & RESET
   Typography, Pill Buttons, Form Primitives, Focus Rings, and Utilities
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Nunito+Sans:ital,opsz,wght@0,6..12,300..900;1,6..12,300..900&family=Oswald:wght@500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  color: var(--sb-ink);
  background-color: var(--sb-white);
}

body {
  font-family: var(--sb-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--sb-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility: Skip Link */
.sb-skip-link {
  position: absolute;
  top: -100px;
  left: var(--sb-space-16);
  background: var(--sb-green-house);
  color: var(--sb-white);
  padding: var(--sb-space-12) var(--sb-space-24);
  font-weight: 700;
  border-radius: var(--sb-radius-pill);
  z-index: 9999;
  text-decoration: none;
  transition: top var(--sb-transition-fast);
}

.sb-skip-link:focus {
  top: var(--sb-space-16);
  outline: 3px solid var(--sb-gold-star);
  outline-offset: 2px;
}

/* Accessible Focus Ring */
:focus-visible {
  outline: 2px solid var(--sb-green-accent);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--sb-transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: inherit;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.5rem, 2vw + 0.8rem, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.6rem, 1.625rem);
  font-weight: 700;
}

h4 {
  font-size: 1.2rem;
  font-weight: 600;
}

p {
  color: inherit;
  margin-bottom: var(--sb-space-16);
}

p:last-child {
  margin-bottom: 0;
}

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

.text-center {
  text-align: center;
}

.text-serif {
  font-family: var(--sb-font-serif);
}

.text-display {
  font-family: var(--sb-font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   BUTTON SYSTEM (Strict Starbucks Pill System)
   ========================================================================== */

.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: max-content;
  align-self: center;
  padding: 7px 16px;
  min-height: 35px;
  border-radius: 50px;
  border: 1px solid currentColor;
  background-color: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
  user-select: none;
}

.sb-btn:hover {
  text-decoration: none;
}

.sb-btn:active {
  transform: scale(0.97);
}

/* Sizes */
.sb-btn--sm {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 600;
}

.sb-btn--md {
  min-height: 35px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 700;
}

.sb-btn--lg {
  min-height: 38px;
  padding: 8px 20px;
  font-size: 16px;
  font-weight: 600;
}

/* Variants */
.sb-btn--outline-dark {
  background-color: transparent;
  border-color: var(--sb-black);
  color: var(--sb-black);
}

.sb-btn--outline-dark:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.sb-btn--solid-dark {
  background-color: var(--sb-black);
  border-color: var(--sb-black);
  color: var(--sb-white);
}

.sb-btn--solid-dark:hover {
  background-color: rgba(0, 0, 0, 0.78);
  border-color: rgba(0, 0, 0, 0.78);
}

.sb-btn--primary,
.sb-btn--green {
  background-color: var(--sb-green-accent);
  border-color: var(--sb-green-accent);
  color: var(--sb-white);
}

.sb-btn--primary:hover,
.sb-btn--green:hover {
  background-color: var(--sb-green-accent-hover);
  border-color: var(--sb-green-accent-hover);
}

.sb-btn--outline-white {
  background-color: transparent;
  border-color: var(--sb-white);
  color: var(--sb-white);
}

.sb-btn--outline-white:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

.sb-btn--solid-white {
  background-color: var(--sb-white);
  border-color: var(--sb-white);
  color: var(--sb-black);
}

.sb-btn--solid-white:hover {
  background-color: rgba(255, 255, 255, 0.88);
}

.sb-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sb-ink);
}

.sb-btn--ghost:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sb-btn--full {
  width: 100%;
}

.sb-btn:disabled,
.sb-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon Button (Circular) */
.sb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--sb-radius-circle);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--sb-ink);
  transition: background-color var(--sb-transition-fast), transform 100ms ease;
}

.sb-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.sb-icon-btn:active {
  transform: scale(0.95);
}

/* Floating Label Form Input */
.sb-form-group {
  position: relative;
  margin-bottom: var(--sb-space-20);
}

.sb-floating-field {
  position: relative;
  display: block;
  width: 100%;
}

.sb-floating-field input,
.sb-floating-field textarea,
.sb-floating-field select {
  width: 100%;
  padding: 24px 16px 8px 16px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--sb-ink);
  background-color: var(--sb-white);
  border: 1px solid var(--sb-border-default);
  border-radius: var(--sb-radius-md);
  outline: none;
  transition: border-color var(--sb-transition-fast), box-shadow var(--sb-transition-fast);
}

.sb-floating-field input:focus,
.sb-floating-field textarea:focus,
.sb-floating-field select:focus {
  border-color: var(--sb-green-accent);
  box-shadow: 0 0 0 1px var(--sb-green-accent);
}

.sb-floating-field.is-invalid input {
  border-color: var(--sb-holiday-cranberry);
}

.sb-floating-field.is-valid input {
  border-color: var(--sb-green-accent);
}

.sb-floating-label {
  position: absolute;
  top: 18px;
  left: 16px;
  font-size: 0.9375rem;
  color: var(--sb-ink-muted);
  pointer-events: none;
  transform-origin: top left;
  transition: transform var(--sb-transition-fast), color var(--sb-transition-fast), font-size var(--sb-transition-fast);
}

/* Float label when focused or not empty */
.sb-floating-field input:focus ~ .sb-floating-label,
.sb-floating-field input:not(:placeholder-shown) ~ .sb-floating-label,
.sb-floating-field textarea:focus ~ .sb-floating-label,
.sb-floating-field textarea:not(:placeholder-shown) ~ .sb-floating-label,
.sb-floating-field select:focus ~ .sb-floating-label,
.sb-floating-field select:valid ~ .sb-floating-label,
.sb-floating-field.is-active .sb-floating-label {
  transform: translateY(-10px) scale(0.78);
  color: var(--sb-ink-muted);
  font-weight: 600;
}

.sb-floating-field input:focus ~ .sb-floating-label {
  color: var(--sb-green-accent);
}

.sb-field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--sb-holiday-cranberry);
  font-weight: 600;
}

.sb-floating-field.is-invalid + .sb-field-error,
.sb-form-group.has-error .sb-field-error {
  display: block;
}

/* Checkboxes */
.sb-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--sb-space-12);
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--sb-ink);
  user-select: none;
}

.sb-checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--sb-border-default);
  border-radius: var(--sb-radius-sm);
  outline: none;
  margin-top: 2px;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  transition: background-color var(--sb-transition-fast), border-color var(--sb-transition-fast);
  cursor: pointer;
}

.sb-checkbox-label input[type="checkbox"]:checked {
  background-color: var(--sb-green-accent);
  border-color: var(--sb-green-accent);
}

.sb-checkbox-label input[type="checkbox"]:checked::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--sb-white);
  border-bottom: 2px solid var(--sb-white);
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
