/* Makeup Coach — Face guide AR demo
   Soft cream/pink aesthetic aligned with web-prototype */

:root {
  --cream: #f6efe6;
  --cream-deep: #ebe2d6;
  --ink: #3a2f2a;
  --muted: #8a7a70;
  --rose: #b87a7a;
  --rose-deep: #9a6060;
  --rose-soft: rgba(184, 122, 122, 0.22);
  --blush: rgba(214, 140, 150, 0.45);
  --lip: rgba(196, 110, 120, 0.4);
  --surface: #f3ebe3;
  --shadow: rgba(58, 47, 42, 0.14);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
}

.app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 28px 20px calc(24px + var(--safe-b));
}

.screen.is-active {
  display: flex;
}

.screen--start,
.screen--finish {
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose);
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 0 auto;
  max-width: 32ch;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--muted);
}

.fine {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--rose-deep);
}

.privacy-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
}

.btn--primary:hover:not(:disabled) {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

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

.btn--ghost:hover:not(:disabled) {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.screen--start .btn--primary,
.screen--finish .btn--primary {
  width: min(100%, 280px);
  margin: 8px auto 0;
}

.screen--finish .btn--ghost {
  width: min(100%, 280px);
  margin: 0 auto;
}

/* Live camera UI */
.screen--live {
  padding: 16px 14px calc(14px + var(--safe-b));
  gap: 12px;
}

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

.live-kicker {
  margin: 0 auto;
  max-width: 36ch;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: var(--muted);
}

.live-step {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.stage {
  position: relative;
  flex: 1;
  min-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream-deep);
  box-shadow: 0 12px 32px var(--shadow);
}

.stage-mirror {
  position: absolute;
  inset: 0;
  /* Mirror selfie view + guides together */
  transform: scaleX(-1);
}

#video,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#video {
  background: #2c2420;
}

#overlay {
  pointer-events: none;
}

.banner {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 3;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(58, 47, 42, 0.82);
  color: #f6efe6;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.35;
}

.loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(246, 239, 230, 0.88);
  color: var(--muted);
  font-size: 0.95rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--cream-deep);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.guide-copy {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
}

.controls .btn {
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.88rem;
}

@media (max-width: 360px) {
  .controls {
    grid-template-columns: 1fr;
  }
}

.guide-block {
  text-align: center;
  min-height: 3.6em;
}

.guide-tip {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
}

.screen--finish .btn--ghost[disabled] {
  opacity: 0.55;
}
