/* ==================================================
   1. CSS Variables (Design Tokens)
   ================================================== */

:root {
  /* Colors */
--color-on-primary: #ffffff;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-border: #0399DE;
  --color-border-soft: #84848488;

  --color-text: #000000;
  --color-text-muted: rgba(255, 255, 255, 0.75);

  --color-primary: #0399DE;
  --color-primary-hover: #0399DE;

  /* Typography */
  --font-base: -apple-system, system-ui, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --font-size-base: 16px;
  --font-size-small: 13px;
  --font-size-large: 18px;

  /* Spacing */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 20px;
  --space-xl: 28px;

  /* Radius */
  --radius-s: 5px;
  --radius-m: 0px;
  --radius-l: 0px;

  /* Shadow */
  --shadow-soft: 0 0px 0px rgba(255, 255, 255, 0.35);
}

/* ==================================================
   2. Base / Reset
   ================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* ==================================================
   3. Layout
   ================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-m);
  background: #0399DE;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  color: #ffffff;
}

main {
  padding: var(--space-m);
  display: grid;
  gap: var(--space-m);
}

/* ==================================================
   4. Cards / Surfaces
   ================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  display: grid;
  gap: var(--space-s);
  box-shadow: var(--shadow-soft);
}

/* ==================================================
   5. Typography
   ================================================== */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

.hint {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* ==================================================
   6. Form Elements
   ================================================== */

input,
button {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--color-border-soft);
  padding: var(--space-s) var(--space-m);
  background: #f4f4f4;
  color: var(--color-text);
}

input::placeholder {
  color: rgba(98, 98, 98, 0.607);
}

input:focus-visible,
button:focus-visible {
  outline: none;
  border-color: var(--color-primary);
}

/* ==================================================
   7. Buttons
   ================================================== */

button {
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  color: var(--color-on-primary);
}

button.primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
}

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================================================
   8. Utility Classes
   ================================================== */

.hidden {
  display: none !important;
}

.spacer-s {
  margin-top: var(--space-s);
}

.spacer-m {
  margin-top: var(--space-m);
}

/* ==================================================
   9. Safe Area Insets (iOS)
   ================================================== */

body {
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  padding-top: calc(var(--space-m) + env(safe-area-inset-top));
}

/* ==================================================
   10. Animations (subtle, iOS-like)
   ================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.25s ease-out;
}