/* ==========================================================================
   ÓTICA SÃO RAPHAEL — Sistema de Pedidos
   Design mobile-first, estilo SaaS premium
   ========================================================================== */

/* --- Variáveis CSS --- */
:root {
  --color-primary: #0f2744;
  --color-primary-light: #1a3a5c;
  --color-primary-dark: #091a2e;
  --color-accent: #c9a227;
  --color-accent-light: #e8c547;
  --color-accent-dark: #a6851f;

  --color-bg: #f0f4f8;
  --color-bg-card: #ffffff;
  --color-bg-input: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-focus: #3b82f6;

  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-warning: #d97706;
  --color-whatsapp: #25d366;

  --shadow-sm: 0 1px 2px rgba(15, 39, 68, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 39, 68, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 39, 68, 0.12);
  --shadow-xl: 0 16px 48px rgba(15, 39, 68, 0.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --header-height: 64px;
  --footer-height: 72px;
  --progress-height: 72px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset e Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(201, 162, 39, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(15, 39, 68, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.required {
  color: var(--color-error);
}

/* --- App Layout --- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
}

/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  box-shadow: var(--shadow-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-logo {
  flex-shrink: 0;
  height: 44px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.logo-placeholder {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(201, 162, 39, 0.5);
  border-radius: var(--radius-md);
  color: var(--color-accent-light);
}

.logo-placeholder svg {
  width: 24px;
  height: 24px;
}

.header-titles {
  min-width: 0;
}

.header-subtitle {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.header-titles h1 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-inverse);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-inverse);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* --- Progress Navigation --- */
.progress-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 16px 8px;
}

.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 16.66%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  list-style: none;
  gap: 4px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.step-dot {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-base);
}

.step-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-light);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color var(--transition-base);
}

.progress-step.active .step-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.15);
}

.progress-step.active .step-label {
  color: var(--color-primary);
  font-weight: 600;
}

.progress-step.completed .step-dot {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-text-inverse);
}

.progress-step.completed .step-label {
  color: var(--color-success);
}

/* --- Main Content --- */
.app-main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--footer-height) + 24px);
}

/* --- Form Steps --- */
.form-step {
  display: none;
  animation: fadeSlideIn var(--transition-slow) forwards;
}

.form-step.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.step-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius-md);
  color: var(--color-accent-light);
  box-shadow: var(--shadow-md);
}

.step-icon svg {
  width: 24px;
  height: 24px;
}

.step-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.step-header p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Cards --- */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.card-title svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

/* --- Form Elements --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  background: var(--color-bg-input);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 52px;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-border-focus);
  background: var(--color-bg-card);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-group input:read-only {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: default;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-light);
}

.form-group input.error,
.form-group textarea.error {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}

.form-group .error-message {
  display: block;
  font-size: 0.75rem;
  color: var(--color-error);
  margin-top: 4px;
}

/* --- Receita Grid --- */
.receita-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.receita-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.receita-header svg {
  width: 18px;
  height: 18px;
}

.receita-header.od {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
}

.receita-header.oe {
  background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
  color: #be185d;
}

.receita-fields {
  gap: 12px;
}

/* --- Selection Cards (Radio) --- */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.selection-grid-compact {
  grid-template-columns: repeat(3, 1fr);
}

.selection-grid-color {
  grid-template-columns: repeat(2, 1fr);
}

.selection-card {
  cursor: pointer;
}

.selection-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.selection-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  min-height: 80px;
  background: var(--color-bg-input);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  transition: all var(--transition-base);
}

.selection-card-inner svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

.selection-card:hover .selection-card-inner {
  border-color: var(--color-primary-light);
  background: var(--color-bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.selection-card input:checked + .selection-card-inner {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(15, 39, 68, 0.04) 0%, rgba(201, 162, 39, 0.08) 100%);
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.1);
  color: var(--color-primary);
}

.selection-card input:checked + .selection-card-inner svg {
  color: var(--color-accent);
}

.selection-card-wide {
  grid-column: 1 / -1;
}

.selection-card-compact .selection-card-inner {
  min-height: 56px;
  padding: 12px;
  font-size: 1rem;
}

.selection-card-color .selection-card-inner {
  min-height: 72px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-swatch.incolor {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.color-swatch.fume {
  background: linear-gradient(135deg, #64748b 0%, #334155 100%);
}

.color-swatch.marrom {
  background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
}

.color-swatch.verde {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.color-swatch.azul {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.color-swatch.degrade {
  background: linear-gradient(180deg, #64748b 0%, transparent 100%);
}

.color-swatch.outra {
  background: conic-gradient(from 0deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #ef4444);
}

/* --- Checkbox Cards --- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.checkbox-card {
  cursor: pointer;
}

.checkbox-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  min-height: 76px;
  background: var(--color-bg-input);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  transition: all var(--transition-base);
}

.checkbox-card-inner svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
}

.checkbox-card:hover .checkbox-card-inner {
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.checkbox-card input:checked + .checkbox-card-inner {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.checkbox-card input:checked + .checkbox-card-inner svg {
  color: var(--color-success);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  min-height: 48px;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: rgba(15, 39, 68, 0.04);
}

.btn-ghost {
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}

.btn-whatsapp:hover {
  background: #1fb855;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 16px 24px;
  font-size: 1rem;
  min-height: 56px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Footer Navigation --- */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 12px rgba(15, 39, 68, 0.06);
  max-width: 720px;
  margin: 0 auto;
}

.step-indicator {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* --- Checkout / Review --- */
.checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.summary-section {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  animation: fadeSlideIn var(--transition-slow) forwards;
}

.summary-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.summary-section-header svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

.summary-section-header h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-item.full {
  grid-column: 1 / -1;
}

.summary-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
}

.summary-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-tag {
  display: inline-flex;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 39, 68, 0.06);
  color: var(--color-primary);
  border-radius: var(--radius-full);
}

.summary-tag.active {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.receita-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.receita-table th,
.receita-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--color-border);
}

.receita-table th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
}

.receita-table td:first-child {
  font-weight: 700;
  background: var(--color-bg);
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* --- Success Actions --- */
.success-actions {
  border: 2px solid var(--color-success);
  background: var(--color-success-bg);
}

.success-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.success-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success);
  border-radius: var(--radius-full);
  color: white;
}

.success-icon svg {
  width: 28px;
  height: 28px;
}

.success-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 4px;
}

.success-header p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.success-phone {
  font-size: 0.9375rem !important;
  font-weight: 700;
  color: var(--color-whatsapp) !important;
  margin-top: 4px;
}

.success-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  animation: modalIn var(--transition-slow) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 162, 39, 0.12);
  border-radius: var(--radius-full);
  color: var(--color-accent);
}

.modal-icon svg {
  width: 28px;
  height: 28px;
}

.modal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 39, 68, 0.7);
  backdrop-filter: blur(4px);
}

.loading-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-content p {
  font-size: 1rem;
  font-weight: 500;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 80px;
  left: 16px;
  right: 16px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
  margin: 0 auto;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  animation: toastIn var(--transition-base) forwards;
  pointer-events: auto;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }
.toast.warning { border-left-color: var(--color-warning); }

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success svg { color: var(--color-success); }
.toast.error svg { color: var(--color-error); }

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- PDF Template (hidden) --- */
.pdf-template {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 794px;
  background: white;
  pointer-events: none;
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 640px) {
  .app-header {
    padding: 14px 24px;
  }

  .header-titles h1 {
    font-size: 1.25rem;
  }

  .progress-nav {
    padding: 14px 24px 10px;
  }

  .step-label {
    font-size: 0.6875rem;
  }

  .app-main {
    padding: 24px;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .receita-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .selection-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .selection-grid-compact {
    grid-template-columns: repeat(6, 1fr);
  }

  .selection-grid-color {
    grid-template-columns: repeat(4, 1fr);
  }

  .selection-card-wide {
    grid-column: span 1;
  }

  .checkbox-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .checkout-actions {
    flex-direction: row;
  }

  .checkout-actions .btn {
    flex: 1;
  }

  .success-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .success-buttons .btn-whatsapp {
    flex: 1 1 100%;
  }

  .app-footer {
    padding: 14px 24px;
  }
}

@media (min-width: 720px) {
  .app {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
  }
}

/* --- Hide footer on review step after confirm --- */
.app-footer.hidden-footer {
  display: none;
}

.app-main.no-footer-padding {
  padding-bottom: 24px;
}

/* --- Print styles --- */
@media print {
  body * {
    visibility: hidden;
  }

  .pdf-template,
  .pdf-template * {
    visibility: visible;
  }

  .pdf-template {
    position: absolute;
    left: 0;
    top: 0;
  }
}

/* --- Login Screen --- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(145deg, #2d1b69 0%, #1a3a5c 50%, #0ea5e9 100%);
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideIn var(--transition-slow) forwards;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  max-width: 220px;
  height: auto;
  margin: 0 auto;
}

.login-card h2 {
  text-align: center;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.login-card > p {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.login-submit {
  width: 100%;
  margin-top: 8px;
}

.login-error {
  font-size: 0.8125rem;
  color: var(--color-error);
  background: var(--color-error-bg);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  text-align: center;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-field .btn-toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  color: var(--color-text-muted);
}

/* --- Card description --- */
.card-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: -8px 0 16px;
}

/* --- Photo Upload --- */
.photo-upload {
  position: relative;
}

.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  min-height: 140px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-input);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.photo-upload-area:hover,
.photo-upload-area:focus-within {
  border-color: var(--color-primary-light);
  background: rgba(15, 39, 68, 0.03);
}

.photo-upload-area svg {
  width: 36px;
  height: 36px;
  color: var(--color-text-muted);
}

.photo-upload-area span {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.photo-upload-area small {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.photo-upload-area.hidden {
  display: none;
}

.photo-preview {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
}

.photo-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #000;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.photo-remove:hover {
  transform: scale(1.05);
}

.photo-remove svg {
  width: 18px;
  height: 18px;
}

.summary-photo {
  margin-top: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.summary-photo img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  background: var(--color-bg);
}

.summary-photo-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  margin-bottom: 6px;
}
