/* ============================================
   OpenIDPhoto - Global AI ID Photo Platform
   Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-secondary: #0f172a;
  --color-accent: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Neutrals */
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-lighter: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --header-height: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--color-primary-dark);
}

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

/* ============================================
   Layout
   ============================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-height);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.header__logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.875rem;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.header__nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
}

.header__nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-light);
  transition: color var(--transition-fast);
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--color-primary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-switcher__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-switcher__toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.lang-switcher__dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  min-width: 180px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.lang-switcher--open .lang-switcher__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher__list {
  list-style: none;
  padding: var(--space-sm);
}

.lang-switcher__item {
  margin: 0;
}

.lang-switcher__link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.lang-switcher__link:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.lang-switcher__link--active {
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Mobile Menu */
.header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-sm);
}

.header__menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-fast);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
}

.btn--ghost:hover {
  background: var(--color-bg-alt);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.0625rem;
}

.btn--sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  padding: var(--space-4xl) 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xl);
}

.hero__title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-secondary);
  margin-bottom: var(--space-xl);
}

.hero__title-highlight {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: var(--space-2xl);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.hero__stats {
  display: flex;
  gap: var(--space-2xl);
}

.hero__stat {
  text-align: left;
}

.hero__stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.hero__stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* Hero Visual */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__image-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--color-primary-light), #ecfdf5);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__demo-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
  width: 80%;
}

.hero__demo-photo {
  width: 120px;
  height: 160px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__demo-photo svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-lighter);
}

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

.hero__demo-specs h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.hero__demo-specs p {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* ============================================
   Upload / Tool Section
   ============================================ */

.tool-section {
  padding: var(--space-4xl) 0;
}

.tool__container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.tool__header {
  padding: var(--space-2xl);
  border-bottom: 1px solid var(--color-border-light);
  text-align: center;
}

.tool__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.tool__header p {
  color: var(--color-text-light);
}

.tool__body {
  padding: var(--space-2xl);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.upload-area:hover,
.upload-area--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.upload-area__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  color: var(--color-primary);
}

.upload-area__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-area__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
}

.upload-area__formats {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}

/* Photo Editor */
.photo-editor {
  display: none;
}

.photo-editor--active {
  display: block;
}

.photo-editor__preview {
  position: relative;
  max-width: 400px;
  margin: 0 auto var(--space-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
}

.photo-editor__canvas {
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}

.photo-editor__canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-editor__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.control-group__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.control-group__options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.color-option:hover,
.color-option--active {
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.size-option {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.size-option:hover,
.size-option--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.photo-editor__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

/* ============================================
   Features Section
   ============================================ */

.features {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-alt);
}

.features__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.features__header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.features__header p {
  font-size: 1.0625rem;
  color: var(--color-text-light);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
}

.feature-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  transition: all var(--transition-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--color-primary);
}

.feature-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card__description {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ============================================
   Categories Section
   ============================================ */

.categories {
  padding: var(--space-4xl) 0;
}

.categories__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.categories__header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.categories__header p {
  font-size: 1.0625rem;
  color: var(--color-text-light);
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.category-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  transition: all var(--transition-base);
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-lg);
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.category-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-secondary);
}

.category-card__count {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* ============================================
   Spec / Landing Page
   ============================================ */

.spec-page {
  padding: var(--space-3xl) 0;
}

.spec-page__header {
  max-width: var(--max-width-narrow);
  margin: 0 auto var(--space-3xl);
}

.spec-page__title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.spec-page__direct-answer {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  padding: var(--space-xl);
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
}

/* Spec Table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-2xl) 0;
  font-size: 0.9375rem;
}

.spec-table th,
.spec-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.spec-table th {
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.spec-table tr:hover td {
  background: var(--color-bg-alt);
}

/* Steps / HowTo */
.steps {
  margin: var(--space-3xl) 0;
}

.steps__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2xl);
}

.steps__list {
  display: grid;
  gap: var(--space-xl);
}

.step {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.step__number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.step__content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.step__content p {
  font-size: 0.9375rem;
  color: var(--color-text-light);
}

/* FAQ Section */
.faq {
  margin: var(--space-3xl) 0;
}

.faq__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2xl);
}

.faq__list {
  display: grid;
  gap: var(--space-md);
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item__question {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.faq-item__question:hover {
  background: var(--color-bg-alt);
}

.faq-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.faq-item--open .faq-item__icon {
  transform: rotate(180deg);
}

.faq-item__answer {
  padding: 0 var(--space-xl) var(--space-lg);
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.7;
  display: none;
}

.faq-item--open .faq-item__answer {
  display: block;
}

/* Compliance Notice */
.compliance-notice {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
}

.compliance-notice__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: var(--space-sm);
}

.compliance-notice__text {
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.6;
}

/* Privacy Notice */
.privacy-notice {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: var(--radius-lg);
}

.privacy-notice__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: var(--space-sm);
}

.privacy-notice__text {
  font-size: 0.875rem;
  color: #064e3b;
  line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--color-bg-dark);
  color: #cbd5e1;
  padding: var(--space-4xl) 0 var(--space-2xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-md);
}

.footer__brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer__column h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-lg);
}

.footer__column ul {
  list-style: none;
}

.footer__column li {
  margin-bottom: var(--space-sm);
}

.footer__column a {
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color var(--transition-fast);
}

.footer__column a:hover {
  color: white;
}

.footer__bottom {
  padding-top: var(--space-2xl);
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #64748b;
}

.footer__bottom-links {
  display: flex;
  gap: var(--space-xl);
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  padding: var(--space-lg) 0;
  font-size: 0.875rem;
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-light);
}

.breadcrumb__separator {
  color: var(--color-text-lighter);
}

.breadcrumb__link {
  color: var(--color-text-light);
}

.breadcrumb__link:hover {
  color: var(--color-primary);
}

.breadcrumb__current {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero__visual {
    order: -1;
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 4rem;
    --space-3xl: 3rem;
  }

  .header__nav-list {
    display: none;
  }

  .header__menu-toggle {
    display: flex;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: var(--space-xl);
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .categories__grid {
    grid-template-columns: 1fr;
  }

  .photo-editor__controls {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .spec-page__title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero__title {
    font-size: 1.875rem;
  }

  .upload-area {
    padding: var(--space-2xl);
  }
}

/* ============================================
   Legacy Class Compatibility (Chinese/Language pages)
   ============================================ */

/* Breadcrumb legacy */
.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  font-size: 0.875rem;
}
.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-light);
}
.breadcrumb-list li + li::before {
  content: '/';
  color: var(--color-text-lighter);
  margin-right: var(--space-xs);
}
.breadcrumb-list a {
  color: var(--color-text-light);
}
.breadcrumb-list a:hover {
  color: var(--color-primary);
}

/* Spec page content legacy */
.spec-content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}
.spec-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}
.spec-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--space-2xl) 0 var(--space-lg);
}

/* Direct answer legacy */
.direct-answer {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  padding: var(--space-xl);
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
  margin: var(--space-xl) 0;
}

/* Spec parameters legacy */
.spec-parameters {
  margin: var(--space-2xl) 0;
}

/* Official acceptance / compliance legacy */
.official-acceptance {
  margin: var(--space-2xl) 0;
}
.acceptance-notice {
  margin: var(--space-xl) 0;
  padding: var(--space-xl);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
}
.acceptance-notice h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: var(--space-sm);
}
.acceptance-notice p {
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.6;
}
.source-ref {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin-top: var(--space-sm);
}
.source-ref a {
  color: var(--color-primary);
}

/* HowTo steps legacy */
.howto-steps {
  margin: var(--space-3xl) 0;
}
.steps-list {
  display: grid;
  gap: var(--space-xl);
  list-style: none;
  counter-reset: step-counter;
}
.steps-list li {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  counter-increment: step-counter;
}
.steps-list li::before {
  flex-shrink: 0;
  content: counter(step-counter);
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
}

/* FAQ legacy */
.faq-section {
  margin: var(--space-3xl) 0;
}
.faq-list {
  display: grid;
  gap: var(--space-md);
}
.faq-section .faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-section .faq-item summary {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
  list-style: none;
}
.faq-section .faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-section .faq-item summary:hover {
  background: var(--color-bg-alt);
}
.faq-section .faq-item[open] summary {
  background: var(--color-bg-alt);
}
.faq-section .faq-item p {
  padding: 0 var(--space-xl) var(--space-lg);
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* Privacy notice legacy */
.privacy-notice h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: var(--space-sm);
}
.privacy-notice p {
  font-size: 0.875rem;
  color: #064e3b;
  line-height: 1.6;
}

/* Related links legacy */
.related-links {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
}
.related-links h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}
.category-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: var(--space-xs) var(--space-sm);
  transition: all var(--transition-fast);
}
.category-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.horizontal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Tool section legacy */
.tool-container {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}
.upload-icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}
.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.upload-hint {
  font-size: 0.875rem;
  color: var(--color-text-light);
}
.tool-options {
  margin-top: var(--space-xl);
}
.option-group {
  margin-bottom: var(--space-lg);
}
.option-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.color-options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.color-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.color-btn:hover,
.color-btn.active {
  border-color: var(--color-primary);
  transform: scale(1.1);
}

/* Button legacy */
.btn-primary,
.btn-secondary,
.btn-process {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary-light);
}
.btn-process {
  background: var(--color-accent);
  color: white;
  width: 100%;
  margin-top: var(--space-lg);
}
.btn-process:hover {
  background: #059669;
}

/* Footer legacy */
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}
.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-md);
}
.footer-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-lg);
}
.footer-section ul {
  list-style: none;
}
.footer-section li {
  margin-bottom: var(--space-sm);
}
.footer-section a {
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color var(--transition-fast);
}
.footer-section a:hover {
  color: white;
}
.footer-section p {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 300px;
  color: #94a3b8;
}
.footer-bottom {
  padding-top: var(--space-2xl);
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #64748b;
}

/* Consent modal */
.consent-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  padding: var(--space-xl);
}
.consent-modal[hidden] {
  display: none !important;
}
.consent-content {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
}
.consent-content h2,
.consent-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.consent-content p {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}
.consent-content ul {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
}
.consent-content ul li {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}
.consent-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* Responsive overrides for legacy classes */
@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
  .spec-content h1 {
    font-size: 1.75rem;
  }
  .steps-list li {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* ============================================
   RTL Support (Arabic)
   ============================================ */

[dir="rtl"] .hero__content {
  text-align: right;
}

[dir="rtl"] .hero__stats {
  justify-content: flex-start;
}

[dir="rtl"] .breadcrumb__list {
  direction: rtl;
}

[dir="rtl"] .spec-page__direct-answer {
  border-left: none;
  border-right: 4px solid var(--color-primary);
}

[dir="rtl"] .step {
  direction: rtl;
}

[dir="rtl"] .faq-item__question {
  text-align: right;
}

/* RTL for legacy classes */
[dir="rtl"] .direct-answer {
  border-left: none;
  border-right: 4px solid var(--color-primary);
}
[dir="rtl"] .breadcrumb-list {
  direction: rtl;
}
[dir="rtl"] .steps-list li::before {
  order: 1;
}
[dir="rtl"] .steps-list li {
  direction: rtl;
}
[dir="rtl"] .faq-section .faq-item summary {
  text-align: right;
}
[dir="rtl"] .footer-bottom {
  direction: rtl;
}
[dir="rtl"] .consent-actions {
  direction: rtl;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .header,
  .footer,
  .tool-section,
  .upload-area {
    display: none;
  }

  body {
    font-size: 12pt;
    color: black;
  }
}
