/* aincare Brand Stylesheet
   Components, layout, responsive rules. */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Long-word safety for DE/TR compound words */
p, li, td, th, dd {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

::selection {
  background: var(--teal-100);
  color: var(--on-surface);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--on-surface);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { margin-bottom: var(--space-md); }

/* --- Layout --- */
.ac-shell {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

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

/* --- Header --- */
.ac-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(249, 249, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ac-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.ac-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--on-surface);
}

.ac-header__logo {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
}

.ac-header__logo img {
  width: 100%;
  height: 100%;
}

.ac-header__wordmark {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--primary);
}

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

.ac-header__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--on-surface-muted);
  text-decoration: none;
  padding: var(--space-xs) 0;
  transition: color 0.2s;
}

.ac-header__link:hover,
.ac-header__link--active {
  color: var(--primary);
  text-decoration: none;
}

.ac-header__link--home {
  display: none;
}

@media (min-width: 641px) {
  .ac-header__link--home {
    display: inline;
  }
}

/* --- Language Toggle --- */
.ac-lang {
  display: flex;
  gap: 2px;
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: 2px;
}

.ac-lang__btn {
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--on-surface-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}

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

.ac-lang__btn[aria-pressed="true"] {
  background: var(--white);
  color: var(--primary);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --- Scroll Reveal --- */
.ac-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.ac-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.ac-reveal--delay-1 { transition-delay: 0.1s; }
.ac-reveal--delay-2 { transition-delay: 0.2s; }
.ac-reveal--delay-3 { transition-delay: 0.3s; }

/* --- Hero --- */
.ac-hero {
  background: linear-gradient(145deg, #004a42 0%, var(--primary) 40%, var(--primary-container) 100%);
  color: var(--on-primary);
  padding: var(--space-4xl) var(--space-xl);
  margin-top: 72px;
  overflow: hidden;
  position: relative;
}

.ac-hero__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.ac-hero__title {
  font-size: var(--text-4xl);
  color: var(--on-primary);
  margin-bottom: var(--space-lg);
}

.ac-hero__subtitle {
  font-size: var(--text-lg);
  opacity: 0.9;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xl);
  font-weight: var(--weight-regular);
}

.ac-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.ac-hero__mockup {
  display: flex;
  justify-content: center;
}

.ac-hero__phone {
  width: 260px;
  height: 500px;
  background: var(--surface-dim);
  border-radius: 36px;
  border: 6px solid #1a2a3a;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.ac-hero__phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Buttons --- */
.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
  text-decoration: none;
  line-height: var(--leading-normal);
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.ac-btn--primary {
  background: var(--white);
  color: var(--primary);
}

.ac-btn--primary:hover {
  background: var(--surface-dim);
  text-decoration: none;
}

.ac-btn--teal {
  background: var(--primary);
  color: var(--white);
}

.ac-btn--teal:hover {
  background: var(--primary-container);
  text-decoration: none;
}

.ac-btn--outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.ac-btn--outline:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* --- Section --- */
.ac-section {
  padding: var(--space-3xl) var(--space-xl);
}

.ac-section--tinted {
  background: var(--teal-50);
}

.ac-section--white {
  background: var(--white);
}

.ac-section__title {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.ac-section__title h2 {
  color: var(--primary);
}

/* --- Feature Cards --- */
.ac-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: var(--container-width);
  margin: 0 auto;
}

.ac-feature {
  text-align: center;
  padding: var(--space-xl);
  background: var(--surface-container);
  border-radius: var(--radius-lg);
  transition: background 0.2s;
}

.ac-feature:hover {
  background: var(--surface-dim);
}

.ac-feature__icon {
  width: 64px;
  height: 64px;
  background: var(--teal-100);
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 32px;
}

.ac-feature h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.ac-feature p {
  color: var(--on-surface-muted);
  margin-bottom: 0;
}

/* --- Steps --- */
.ac-steps {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

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

.ac-step:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}

.ac-step__number {
  width: 72px;
  height: 72px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.ac-step h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.ac-step p {
  color: var(--on-surface-muted);
  margin-bottom: 0;
}

/* --- Trust badges --- */
.ac-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
}

.ac-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--primary);
}

.ac-badge svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

/* --- Footer --- */
.ac-footer {
  background: var(--primary);
  color: var(--on-primary);
  padding: var(--space-2xl) var(--space-xl);
}

.ac-footer__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
}

.ac-footer__links {
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.ac-footer .ac-lang {
  flex-shrink: 0;
}

.ac-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ac-footer__logo {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.ac-footer__logo img {
  width: 100%;
  height: 100%;
}

.ac-footer__copy {
  opacity: 0.7;
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
}

.ac-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.ac-footer__links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color 0.2s;
}

.ac-footer__links a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Footer language toggle overrides */
.ac-footer .ac-lang {
  background: rgba(255, 255, 255, 0.1);
}

.ac-footer .ac-lang__btn {
  color: rgba(255, 255, 255, 0.7);
}

.ac-footer .ac-lang__btn:hover {
  color: var(--white);
}

.ac-footer .ac-lang__btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  box-shadow: none;
}

/* --- Legal Page Content --- */
.ac-legal {
  padding-top: 72px;
}

.ac-legal__header {
  background: var(--teal-50);
  padding: var(--space-2xl) var(--space-xl);
}

.ac-legal__header h1 {
  font-size: var(--text-3xl);
  color: var(--primary);
}

.ac-legal__date {
  color: var(--on-surface-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
}

.ac-legal__body {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

.ac-legal__body h2 {
  font-size: var(--text-2xl);
  color: var(--primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.ac-legal__body h2:first-child {
  margin-top: 0;
}

.ac-legal__body h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.ac-legal__body p {
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
}

.ac-legal__body ul,
.ac-legal__body ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.ac-legal__body li {
  margin-bottom: var(--space-sm);
  line-height: var(--leading-relaxed);
}

.ac-legal__body a {
  color: var(--primary);
  text-decoration: underline;
}

.ac-legal__body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
}

.ac-legal__body th,
.ac-legal__body td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
}

.ac-legal__body th {
  background: var(--surface-container);
  font-weight: var(--weight-semibold);
}

.ac-legal__body tr:nth-child(even) td {
  background: var(--surface);
}

/* --- CTA Pulse --- */
@keyframes ac-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

.ac-btn--pulse {
  animation: ac-pulse 3s ease-in-out infinite;
}

/* --- Chat Demo (hero phone mockup) --- */
.ac-chat-demo {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  padding: var(--space-md);
  gap: var(--space-sm);
  overflow: hidden;
}

.ac-chat-demo__header {
  text-align: center;
  padding: var(--space-sm);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--primary);
  border-bottom: 1px solid var(--surface-container);
}

.ac-chat-demo__messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-sm);
  overflow: hidden;
}

.ac-chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ac-chat-bubble--visible {
  opacity: 1;
  transform: translateY(0);
}

.ac-chat-bubble--user {
  align-self: flex-end;
  background: var(--primary);
  color: var(--on-primary);
  border-bottom-right-radius: 4px;
}

.ac-chat-bubble--ai {
  align-self: flex-start;
  background: var(--surface-container);
  color: var(--on-surface);
  border-bottom-left-radius: 4px;
}

.ac-chat-demo__input {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs);
  background: var(--surface-container);
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
}

.ac-chat-demo__mic {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-chat-demo__mic svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.ac-chat-demo__placeholder {
  font-size: 12px;
  color: var(--on-surface-muted);
  padding-left: var(--space-sm);
}

/* --- FAQ Accordion --- */
.ac-faq-item {
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: background 0.2s;
}

.ac-faq-question {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--on-surface);
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: var(--surface-container);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.ac-faq-question:hover {
  background: var(--surface-dim);
}

.ac-faq-question::after {
  content: "+";
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.ac-faq-item[open] .ac-faq-question::after {
  transform: rotate(45deg);
}

.ac-faq-question::-webkit-details-marker {
  display: none;
}

.ac-faq-answer {
  padding: var(--space-md) var(--space-lg);
  color: var(--on-surface-muted);
  line-height: var(--leading-relaxed);
}

/* --- Signup Form --- */
.ac-signup-intro {
  font-size: var(--text-lg);
  color: var(--on-surface-muted);
  max-width: 640px;
  margin: var(--space-sm) auto 0;
}

.ac-signup-form[hidden] {
  display: none;
}

.ac-signup-form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.ac-signup-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.ac-signup-form__fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.ac-signup-form label,
.ac-signup-form legend {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--on-surface);
}

.ac-signup-form input[type="email"],
.ac-signup-form input[type="tel"] {
  font-family: var(--font-family);
  font-size: var(--text-lg);
  padding: var(--space-md);
  border: 2px solid var(--outline-variant);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--on-surface);
  min-height: 56px;
  width: 100%;
  transition: border-color 0.2s;
}

.ac-signup-form input[type="email"]:focus,
.ac-signup-form input[type="tel"]:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.ac-signup-form__input--error {
  border-color: var(--error);
}

.ac-signup-form__hint {
  font-size: var(--text-sm);
  color: var(--on-surface-muted);
  margin-bottom: 0;
}

.ac-signup-form__error {
  font-size: var(--text-sm);
  color: var(--error);
  font-weight: var(--weight-medium);
  margin-bottom: 0;
  min-height: 0;
}

.ac-signup-form__error:empty {
  display: none;
}

/* Purpose toggles — pick one or both */
.ac-signup-form__toggles {
  display: flex;
  margin-top: var(--space-xs);
  border: 2px solid var(--outline-variant);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ac-signup-form__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-medium);
  cursor: pointer;
  padding: var(--space-md);
  min-height: 52px;
  flex: 1;
  text-align: center;
  transition: background 0.2s, color 0.2s;
  border-right: 2px solid var(--outline-variant);
}

.ac-signup-form__toggle:last-child {
  border-right: none;
}

.ac-signup-form__toggle:hover {
  background: var(--surface-dim);
}

.ac-signup-form__toggle:has(input:checked) {
  background: var(--primary);
  color: var(--on-primary);
}

/* Checkmark on selected toggle */
.ac-signup-form__toggle:has(input:checked)::before {
  content: "\2713";
  margin-right: var(--space-xs);
  font-weight: var(--weight-bold);
}

/* Focus indicator for keyboard navigation */
.ac-signup-form__toggle:has(input:focus-visible) {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  z-index: 1;
}

.ac-signup-form__toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Checkbox — large touch target */
.ac-signup-form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-weight: var(--weight-regular);
  cursor: pointer;
  padding: var(--space-sm) 0;
}

.ac-signup-form__checkbox input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.ac-signup-form__checkbox a {
  color: var(--primary);
  text-decoration: underline;
}

.ac-signup-form__submit {
  align-self: stretch;
  font-size: var(--text-lg);
  min-height: 56px;
}

.ac-signup-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Honeypot — invisible to humans */
.ac-signup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state */
.ac-signup-success {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

.ac-signup-success__icon {
  width: 80px;
  height: 80px;
  background: var(--teal-50);
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.ac-signup-success__icon svg {
  fill: var(--primary);
}

.ac-signup-success h3 {
  font-size: var(--text-2xl);
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.ac-signup-success p {
  font-size: var(--text-lg);
  color: var(--on-surface-muted);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .ac-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ac-hero__actions {
    justify-content: center;
  }

  .ac-hero__phone {
    width: 220px;
    height: 420px;
  }

  .ac-features {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .ac-step,
  .ac-step:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  h1 { font-size: clamp(28px, 6vw, var(--text-4xl)); }
  h2 { font-size: clamp(24px, 5vw, var(--text-3xl)); }
}

@media (max-width: 640px) {
  :root {
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;
  }

  .ac-header__inner {
    padding: 0 var(--space-md);
    height: 60px;
  }

  .ac-hero {
    margin-top: 60px;
    padding: var(--space-2xl) var(--space-md);
  }

  .ac-legal {
    padding-top: 60px;
  }

  .ac-footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
  }

  .ac-footer__links {
    justify-content: center;
  }

  .ac-header__nav {
    gap: var(--space-sm);
  }

  .ac-lang__btn {
    padding: var(--space-xs) 6px;
    font-size: 14px;
    min-height: 32px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, button, .ac-feature, .ac-btn, .ac-lang__btn, .ac-header__link,
  .ac-footer__links a {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
  }
}
