/* ============================================
   Design Kit — Mobile App Design System
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-primary: #070707;
  --color-accent: #EC0D0D;
  --color-accent-hover: #ff3333;
  --color-neutral: #FFFFFF;
  
  /* Semantic colors */
  --color-bg: var(--color-primary);
  --color-text: var(--color-neutral);
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-border: rgba(255, 255, 255, 0.2);
  --color-input-bg: var(--color-neutral);
  --color-input-text: var(--color-primary);
  --color-placeholder: rgba(7, 7, 7, 0.5);
  
  /* Typography */
  --font-heading: 'Saira SemiCondensed', sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  
  /* Font sizes - mobile first */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 2rem;      /* 32px */
  --text-4xl: 2.5rem;    /* 40px */
  --text-5xl: 3rem;      /* 48px */
  
  /* Font weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-black: 900;
  
  /* Line heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  
  /* Border radius */
  --radius-button: 99px;
  --radius-card: 24px;
  --radius-input: 24px;
  --radius-input-pill: 99px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- Base Reset & Typography --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Headings */
h1, h2, h3, h4,
.dk-heading-1, .dk-heading-2, .dk-heading-3, .dk-heading-4,
.dk-heading-accent,
.dk-section-title {
  font-family: var(--font-heading);
  font-weight: var(--font-black);
  text-transform: uppercase;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
}

h1, .dk-heading-1 {
  font-size: var(--text-4xl);
}

@media (max-width: 767px) {
  h1, .dk-heading-1 {
    font-size: var(--text-3xl);
  }
}

h2, .dk-heading-2 {
  font-size: var(--text-3xl);
}

h3, .dk-heading-3 {
  font-size: var(--text-2xl);
}

h4, .dk-heading-4 {
  font-size: var(--text-xl);
}

/* Heading with accent (split color) */
.dk-heading-accent .dk-accent {
  color: var(--color-accent);
}

/* Paragraphs */
p, .dk-text {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.dk-text-muted {
  color: var(--color-text-muted);
}

.dk-text-sm {
  font-size: var(--text-sm);
}

/* Captions / Labels */
.dk-caption,
.dk-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Labels and text inside white cards need dark color */
.dk-card .dk-label,
.dk-card .dk-checkbox-label {
  color: var(--color-primary);
  opacity: 0.9;
}

.dk-card .dk-text,
.dk-card .dk-text-muted {
  color: var(--color-primary);
}

.dk-card .dk-text-muted {
  opacity: 0.7;
}

/* --- Buttons --- */
.dk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.dk-btn:active {
  transform: scale(0.98);
}

/* Primary button (red) */
.dk-btn-primary {
  background-color: var(--color-accent);
  color: var(--color-neutral);
}

.dk-btn-primary:hover {
  opacity: 0.9;
}

/* Secondary button (white with red border) */
.dk-btn-secondary {
  background-color: var(--color-neutral);
  color: var(--color-primary);
  border: 2px solid var(--color-accent);
}

.dk-btn-secondary:hover {
  opacity: 0.95;
}

/* Outline / Ghost button */
.dk-btn-outline {
  background-color: transparent;
  color: var(--color-neutral);
  border: 2px solid var(--color-neutral);
}

.dk-btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Button with icon */
.dk-btn .dk-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dk-btn-icon-only {
  padding: var(--space-4);
  width: 48px;
  height: 48px;
}

/* Button sizes */
.dk-btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.dk-btn-lg {
  padding: var(--space-5) var(--space-8);
  font-size: var(--text-lg);
}

/* Full width button */
.dk-btn-block {
  width: 100%;
}

/* CTA Button — app style: SVG shape. Fixed 352×54. */
.dk-btn-cta {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 54px 0 var(--space-6);
  color: var(--color-neutral);
  text-decoration: none;
  border: none;
  background: none;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  width: 352px;
  height: 54px;
  flex-shrink: 0;
  overflow: hidden;
}

@media (max-width: 767px) {
  .dk-btn-cta {
    width: 330px;
  }
}

.dk-btn-cta:hover {
  opacity: 0.95;
}

.dk-btn-cta:active {
  transform: scale(0.98);
}

.dk-btn-cta .dk-btn-cta-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dk-btn-cta .dk-btn-cta-text {
  flex: 1;
  text-align: center;
  padding-right: 54px;
  position: relative;
  z-index: 1;
}

.dk-btn-cta .dk-btn-cta-arrow {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.dk-btn-cta .dk-icon {
  width: 20px;
  height: 20px;
  color: var(--color-neutral);
}

/* --- Forms --- */
.dk-form-group {
  margin-bottom: var(--space-5);
}

.dk-input,
.dk-select,
.dk-textarea {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-text);
  font-size: var(--text-base);
  color: var(--color-input-text);
  background-color: var(--color-input-bg);
  border: none;
  border-radius: var(--radius-input-pill);
  transition: box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

/* App-style form: pill-shaped inputs (except message textarea) */
.dk-form-app .dk-input,
.dk-form-app .dk-select,
.dk-form-app .dk-textarea:not(.dk-textarea-message) {
  border-radius: var(--radius-input-pill);
}

.dk-input::placeholder,
.dk-textarea::placeholder {
  color: var(--color-placeholder);
}

.dk-input:focus,
.dk-select:focus,
.dk-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-accent);
}

.dk-input.dk-input-error,
.dk-textarea.dk-input-error {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.dk-input-error-msg {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-accent);
}

/* Select */
.dk-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23070707' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 20px;
  padding-right: 48px;
}

/* Textarea */
.dk-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Message textarea — 24px border radius (not pill) */
.dk-textarea.dk-textarea-message {
  border-radius: var(--radius-card);
}

/* Checkbox */
.dk-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.dk-checkbox-input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.dk-checkbox-label {
  font-size: var(--text-base);
  color: var(--color-text);
}

/* Range slider */
.dk-range {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: var(--radius-button);
}

.dk-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
}

.dk-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* --- Cards --- */
.dk-card {
  background-color: var(--color-neutral);
  color: var(--color-primary);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
}

.dk-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-black);
  text-transform: uppercase;
  margin: 0 0 var(--space-3);
  color: var(--color-primary);
}

.dk-card-text {
  font-size: var(--text-sm);
  color: var(--color-primary);
  opacity: 0.8;
  margin: 0;
  line-height: var(--leading-relaxed);
}

/* Card with accent border */
.dk-card-accent {
  border-color: var(--color-accent);
}

/* Accordion — app style: white cards, black text, red circle with arrow */
.dk-accordion-item {
  background-color: var(--color-neutral);
  border-radius: var(--radius-button);
  margin-bottom: var(--space-3);
  overflow: hidden;
  border: none;
}

.dk-accordion-item.dk-accordion-active {
  border-radius: var(--radius-card);
}

.dk-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-black);
  text-transform: uppercase;
  color: var(--color-primary);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.dk-accordion-header .dk-accordion-icon-wrap {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: var(--color-neutral);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dk-accordion-header .dk-icon {
  transition: transform var(--transition-fast);
  width: 20px;
  height: 20px;
}

.dk-accordion-item.dk-accordion-active .dk-accordion-header .dk-icon {
  transform: rotate(180deg);
}

.dk-accordion-content {
  padding: 0 var(--space-5) var(--space-5);
  display: none;
}

.dk-accordion-item.dk-accordion-active .dk-accordion-content {
  display: block;
}

.dk-accordion-content p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-primary);
  opacity: 0.7;
  line-height: var(--leading-relaxed);
}

/* Progress bar */
.dk-progress {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-button);
  overflow: hidden;
}

.dk-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-button);
  transition: width var(--transition-base);
}

/* --- Badges --- */
.dk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-button);
}

.dk-badge-primary {
  background-color: var(--color-accent);
  color: var(--color-neutral);
}

.dk-badge-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.dk-badge-neutral {
  background-color: var(--color-neutral);
  color: var(--color-primary);
}

/* --- Icons --- */
.dk-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dk-icon-sm {
  width: 16px;
  height: 16px;
}

.dk-icon-lg {
  width: 32px;
  height: 32px;
}

/* Icon button (circular) */
.dk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.dk-icon-btn-primary {
  background-color: var(--color-accent);
  color: var(--color-neutral);
}

.dk-icon-btn-secondary {
  background-color: var(--color-neutral);
  color: var(--color-primary);
}

/* --- Color Palette Display --- */
.dk-color-swatch {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-card);
  margin-bottom: var(--space-2);
}

.dk-color-swatch-primary { background-color: var(--color-primary); border: 2px solid var(--color-neutral); }
.dk-color-swatch-accent { background-color: var(--color-accent); }
.dk-color-swatch-neutral { background-color: var(--color-neutral); border: 2px solid var(--color-border); }

/* --- Layout utilities --- */
.dk-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-4);
}

.dk-section {
  margin-bottom: var(--space-10);
}

.dk-section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

.dk-section-title .dk-accent {
  color: var(--color-accent);
}

/* Grid for color swatches */
.dk-grid {
  display: grid;
  gap: var(--space-4);
}

.dk-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Responsive (tablet+) --- */
@media (min-width: 768px) {
  :root {
    --text-4xl: 3rem;
    --text-5xl: 4rem;
  }
  
  .dk-container {
    max-width: 720px;
    padding: var(--space-6);
  }
}
