/* ============================================================
   MANUAL DA ASSINATURA — Design System v2
   Light mode first, premium SaaS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Dancing+Script:wght@400;500;600;700&family=Great+Vibes&family=Pinyon+Script&family=Sacramento&family=Alex+Brush&family=Allura&family=Yellowtail&family=Pacifico&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --white:          #ffffff;
  --bg:             #f4f4f7;
  --bg-2:           #ebebf0;
  --bg-3:           #e2e2e8;
  --surface:        #ffffff;
  --surface-2:      #fafafa;

  --blue:           #2563eb;
  --blue-dark:      #1d4ed8;
  --blue-deeper:    #1e40af;
  --blue-light:     #eff6ff;
  --blue-mid:       #dbeafe;
  --blue-ring:      rgba(37,99,235,0.18);

  --ink:            #09090b;
  --ink-2:          #27272a;
  --ink-3:          #52525b;
  --ink-4:          #71717a;
  --ink-5:          #a1a1aa;
  --ink-6:          #d4d4d8;
  --ink-7:          #e4e4e7;

  /* Strong borders for light mode */
  --border:         rgba(0,0,0,0.14);
  --border-2:       rgba(0,0,0,0.20);
  --border-3:       rgba(0,0,0,0.28);
  --border-input:   #a8a8b0;

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.14), 0 8px 24px rgba(0,0,0,0.07);
  --shadow-2xl: 0 40px 80px rgba(0,0,0,0.18), 0 16px 32px rgba(0,0,0,0.10);

  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-3xl: 40px;
  --r-full: 9999px;

  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --dur-fast:    150ms;
  --dur-mid:     240ms;
  --dur-slow:    360ms;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100%;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--ink-6); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-5); }

/* ── Selection ──────────────────────────────────────────── */
::selection { background: var(--blue-mid); color: var(--blue-dark); }

/* ── Focus ──────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ── Typography ─────────────────────────────────────────── */
.t-display { font-size: clamp(2.6rem, 5.5vw, 4.2rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; }
.t-h1      { font-size: clamp(1.9rem, 3.8vw, 3rem);   font-weight: 700; letter-spacing: -0.03em;  line-height: 1.12; }
.t-h2      { font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2;  }
.t-h3      { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; }
.t-body    { font-size: 0.9375rem; font-weight: 400; line-height: 1.65; }
.t-small   { font-size: 0.8125rem; font-weight: 400; line-height: 1.55; }
.t-xs      { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; }
.t-label   { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.005em; }

.c-ink     { color: var(--ink); }
.c-ink-2   { color: var(--ink-2); }
.c-ink-3   { color: var(--ink-3); }
.c-ink-4   { color: var(--ink-4); }
.c-blue    { color: var(--blue); }

/* ── Layout ─────────────────────────────────────────────── */
.container        { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.container--wide  { max-width: 1400px; }
.container--narrow{ max-width: 720px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.875rem; font-weight: 500; line-height: 1;
  padding: 0 18px; height: 40px; border-radius: var(--r-md);
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap; position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn--primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.35), 0 0 0 0 var(--blue-ring);
}
.btn--primary:hover  { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }
.btn--primary:active { background: var(--blue-deeper); transform: translateY(0); box-shadow: 0 1px 3px rgba(37,99,235,0.2); }

.btn--secondary { background: var(--blue-light); color: var(--blue); border: 1.5px solid var(--blue-mid); }
.btn--secondary:hover { background: var(--blue-mid); transform: translateY(-1px); }

.btn--ghost { color: var(--ink-3); background: transparent; }
.btn--ghost:hover { background: var(--bg-2); color: var(--ink); }

.btn--outline {
  color: var(--ink-2); background: var(--white);
  border: 1.5px solid var(--border-2);
  box-shadow: var(--shadow-xs);
}
.btn--outline:hover { border-color: var(--ink-5); color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn--outline:active { transform: translateY(0); }

.btn--danger { background: #fee2e2; color: #dc2626; border: 1.5px solid #fca5a5; }
.btn--danger:hover { background: #dc2626; color: #fff; }

.btn--lg  { height: 48px; padding: 0 28px; font-size: 0.9375rem; border-radius: var(--r-lg); }
.btn--xl  { height: 56px; padding: 0 36px; font-size: 1rem; font-weight: 600; border-radius: var(--r-lg); }
.btn--xxl { height: 64px; padding: 0 44px; font-size: 1.0625rem; font-weight: 600; border-radius: var(--r-xl); }
.btn--sm  { height: 34px; padding: 0 14px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn--xs  { height: 28px; padding: 0 10px; font-size: 0.75rem; border-radius: var(--r-sm); }
.btn--icon    { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.btn--icon-lg { width: 44px; height: 44px; padding: 0; border-radius: var(--r-lg); }
.btn--full { width: 100%; }

/* Ripple */
.btn .ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0); animation: ripple-anim 0.55s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.card--flat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
}
.card--elevated { box-shadow: var(--shadow-lg); border-color: var(--border); }
.card--inset { background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-lg); }
.card-body     { padding: 28px; }
.card-body--sm { padding: 20px; }
.card-body--lg { padding: 40px; }
.card-body--xl { padding: 52px; }

/* Section divider inside card */
.card-divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── Form elements ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0.005em; }
.form-label--required::after { content: ' *'; color: #dc2626; }

.form-input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--white);
  border: 1.5px solid var(--border-input);
  border-radius: var(--r-md);
  font-size: 0.9375rem; color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast);
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--ink-5); }
.form-input:hover { border-color: #9ca3af; }
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); background: var(--white); }
.form-input:read-only { background: var(--bg-2); color: var(--ink-4); cursor: not-allowed; }
.form-input--lg { height: 52px; padding: 0 18px; font-size: 1rem; border-radius: var(--r-lg); }
.form-input--error { border-color: #ef4444; }
.form-input--error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.form-textarea {
  width: 100%; padding: 12px 14px; min-height: 100px; resize: vertical;
  background: var(--white); border: 1.5px solid var(--border-input);
  border-radius: var(--r-md); font-size: 0.9375rem; color: var(--ink); line-height: 1.5;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }

.form-select {
  width: 100%; height: 44px; padding: 0 36px 0 14px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1.5px solid var(--border-input);
  border-radius: var(--r-md); font-size: 0.9375rem; color: var(--ink);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }

.form-error { font-size: 0.8125rem; color: #dc2626; font-weight: 400; display: flex; align-items: center; gap: 5px; }
.form-hint  { font-size: 0.8125rem; color: var(--ink-4); line-height: 1.5; }

/* Toggle switch */
.toggle {
  position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--ink-7); border-radius: 24px;
  transition: background var(--dur-fast) var(--ease);
  border: 1.5px solid var(--border-2);
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 2px; top: 1px;
  background: var(--white); border-radius: 50%;
  transition: transform var(--dur-fast) var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--blue); border-color: var(--blue-dark); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Radio cards */
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card label {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-2); background: var(--white);
  font-size: 0.875rem; font-weight: 500; color: var(--ink-3);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.radio-card label:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.radio-card input:checked + label { border-color: var(--blue); color: var(--blue); background: var(--blue-light); font-weight: 600; }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge--blue  { background: var(--blue-light); color: var(--blue-dark); border-color: var(--blue-mid); }
.badge--gray  { background: var(--bg-2); color: var(--ink-3); border-color: var(--border); }
.badge--green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge--amber { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge--red   { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-5); font-size: 0.8125rem; font-weight: 400;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full); font-weight: 600; flex-shrink: 0;
  background: var(--blue-light); color: var(--blue);
  border: 1.5px solid var(--blue-mid);
}
.avatar--xs  { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar--sm  { width: 30px; height: 30px; font-size: 0.6875rem; }
.avatar--md  { width: 38px; height: 38px; font-size: 0.875rem; }
.avatar--lg  { width: 52px; height: 52px; font-size: 1.0625rem; }
.avatar--xl  { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar--2xl { width: 96px; height: 96px; font-size: 2rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner--blue { border-color: var(--blue-ring); border-top-color: var(--blue); }
.spinner--gray { border-color: var(--border-2); border-top-color: var(--ink-4); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alert boxes ─────────────────────────────────────────── */
.alert {
  padding: 14px 16px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 400; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid transparent;
}
.alert--info    { background: var(--blue-light); border-color: var(--blue-mid); color: var(--blue-deeper); }
.alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.alert--error   { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.alert--warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--ink-2); color: #fff;
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  font-size: 0.875rem; font-weight: 450; pointer-events: all;
  animation: toast-in 0.32s var(--ease-spring) forwards;
  max-width: 380px; border: 1px solid rgba(255,255,255,0.08);
}
.toast--success { background: #14532d; }
.toast--error   { background: #7f1d1d; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--white);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
  min-width: 190px; padding: 5px; z-index: 999;
  animation: dropdown-in 0.16s var(--ease-spring) both;
  transform-origin: top right;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 0.875rem; color: var(--ink-2); cursor: pointer;
  transition: all var(--dur-fast) var(--ease); text-decoration: none;
}
.dropdown-item:hover { background: var(--bg); color: var(--ink); }
.dropdown-item--danger { color: #dc2626; }
.dropdown-item--danger:hover { background: #fef2f2; color: #dc2626; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(9,9,11,0.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--white); border-radius: var(--r-2xl); width: 100%; max-width: 460px;
  box-shadow: var(--shadow-2xl); border: 1.5px solid var(--border);
  animation: modal-in 0.22s var(--ease-spring) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { padding: 28px 28px 20px; border-bottom: 1px solid var(--border); }
.modal-body   { padding: 24px 28px; }
.modal-footer { padding: 20px 28px 28px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Utilities ───────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; }   .gap-2 { gap: 8px; }   .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }  .gap-5 { gap: 20px; }  .gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }  .gap-10{ gap: 40px; }
.w-full   { width: 100%; }  .h-full { height: 100%; }
.min-w-0  { min-width: 0; }
.flex-1   { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative  { position: relative; }
.absolute  { position: absolute; }
.hidden    { display: none !important; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; }
.rounded-full { border-radius: var(--r-full); }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fade-up   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fade-in   { from { opacity:0; } to { opacity:1; } }
@keyframes scale-in  { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
@keyframes slide-r   { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:translateX(0); } }
@keyframes slide-l   { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.85)} }
@keyframes draw-path { from{stroke-dashoffset:1200} to{stroke-dashoffset:0} }
@keyframes shimmer   { from{background-position:-400px 0} to{background-position:400px 0} }

.anim-fade-up  { animation: fade-up  var(--dur-slow) var(--ease-out) both; }
.anim-fade-in  { animation: fade-in  var(--dur-slow) var(--ease-out) both; }
.anim-scale-in { animation: scale-in var(--dur-mid)  var(--ease-spring) both; }
.anim-slide-r  { animation: slide-r  var(--dur-slow) var(--ease-out) both; }
.anim-slide-l  { animation: slide-l  var(--dur-slow) var(--ease-out) both; }

.delay-0  { animation-delay: 0ms; }
.delay-1  { animation-delay: 80ms; }
.delay-2  { animation-delay: 160ms; }
.delay-3  { animation-delay: 240ms; }
.delay-4  { animation-delay: 320ms; }
.delay-5  { animation-delay: 400ms; }
.delay-6  { animation-delay: 500ms; }
.delay-7  { animation-delay: 620ms; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ── Print styles ────────────────────────────────────────── */
@media print {
  .nav, .sidebar, .mobile-nav, .app-topbar,
  .step-nav, .btn, .toast-container { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hide-mobile  { display: none !important; }
  .card-body--lg { padding: 24px; }
  .card-body--xl { padding: 28px; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
