/* ============================================================
   VeeNest — shared.css
   CSS compartilhado entre todas as páginas do site.
   Importar em todos os HTMLs antes de qualquer estilo local.
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === TOKENS DE COR — LIGHT === */
:root {
  --bg:                #FAF7F0;
  --bg-secondary:      #F2EDE0;
  --bg-card:           #FFFFFF;
  --bg-input:          #FDFAF5;
  --border:            #E8E2D0;
  --border-focus:      #8B5CC8;

  --vee-purple:        #8B5CC8;
  --vee-purple-hover:  #7448B0;
  --vee-purple-pale:   #F3EDFB;
  --vee-purple-border: rgba(139,92,200,0.18);

  --branch-brown:      #8B6914;
  --branch-brown-light:#C49A28;

  --ink-primary:       #2C2416;
  --ink-secondary:     #5C4830;
  --ink-tertiary:      #8A7058;

  --success:           #4A9E5C;
  --success-pale:      #EDF7F0;
  --warning:           #E8A020;
  --warning-pale:      #FEF6E7;
  --error:             #C84040;
  --error-pale:        #FEF0F0;

  --shadow-sm:         rgba(139,105,20,0.08);
  --shadow-md:         rgba(139,105,20,0.12);
  --shadow-lg:         rgba(139,105,20,0.18);
}

/* === TOKENS DE COR — DARK === */
[data-theme="dark"] {
  --bg:                #1A150F;
  --bg-secondary:      #231C14;
  --bg-card:           #28221A;
  --bg-input:          #231C14;
  --border:            rgba(200,160,80,0.14);
  --border-focus:      #A87ADE;

  --vee-purple:        #A87ADE;
  --vee-purple-hover:  #8B5CC8;
  --vee-purple-pale:   rgba(60,35,90,0.45);
  --vee-purple-border: rgba(168,122,222,0.22);

  --branch-brown:      #D4B060;
  --branch-brown-light:#E8C878;

  --ink-primary:       #F5EDD8;
  --ink-secondary:     #C8B090;
  --ink-tertiary:      #8A7058;

  --success:           #5ABF6E;
  --success-pale:      rgba(74,158,92,0.15);
  --warning:           #F0B840;
  --warning-pale:      rgba(232,160,32,0.15);
  --error:             #E06060;
  --error-pale:        rgba(200,64,64,0.15);

  --shadow-sm:         rgba(0,0,0,0.20);
  --shadow-md:         rgba(0,0,0,0.28);
  --shadow-lg:         rgba(0,0,0,0.38);
}

/* === BASE === */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink-primary);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

/* === LOGO === */
.vn-logo {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
  user-select: none;
}
.vn-logo .vee  { color: var(--vee-purple); }
.vn-logo .nest { color: var(--branch-brown); }

/* === CARD === */
.vn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 4px 24px var(--shadow-md);
  transition: background 0.3s, border-color 0.3s;
}

/* === BOTÕES === */
.vn-btn {
  display: block;
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: none;
  outline: none;
  transition: opacity 0.15s, transform 0.1s;
  margin-bottom: 10px;
  line-height: 1.2;
}
.vn-btn:active { transform: scale(0.97); }
.vn-btn:focus-visible { outline: 2px solid var(--vee-purple); outline-offset: 2px; }

.vn-btn-primary {
  background: var(--vee-purple);
  color: #fff;
}
.vn-btn-primary:hover { opacity: 0.88; }

.vn-btn-secondary {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
}
.vn-btn-secondary:hover { border-color: var(--vee-purple); color: var(--vee-purple); }

.vn-btn-warning {
  background: var(--warning);
  color: #fff;
}
.vn-btn-warning:hover { opacity: 0.88; }

/* Spinner dentro de botão */
.vn-btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vn-spin 0.7s linear infinite;
  display: none;
  margin: 0 auto;
}
.vn-btn.loading .vn-btn-label   { display: none; }
.vn-btn.loading .vn-btn-spinner { display: block; }

/* === SPINNER GERAL === */
.vn-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--vee-purple-pale);
  border-top-color: var(--vee-purple);
  border-radius: 50%;
  animation: vn-spin 0.8s linear infinite;
}
@keyframes vn-spin { to { transform: rotate(360deg); } }

.vn-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  text-align: center;
}
.vn-spinner-text {
  font-size: 15px;
  color: var(--ink-secondary);
}

/* === MASCOTE === */
.vn-mascot {
  display: block;
  margin: 0 auto 16px;
  object-fit: contain;
}
.vn-mascot-sm  { width: 80px;  height: 80px;  }
.vn-mascot-md  { width: 120px; height: 120px; }
.vn-mascot-lg  { width: 160px; height: 160px; }

.vn-mascot-idle {
  animation: vn-idle 4s ease-in-out infinite;
}
.vn-mascot-celebrate {
  animation: vn-idle 4s ease-in-out infinite;
}
.vn-mascot-droop {
  animation: vn-droop 3s ease-in-out infinite;
}
.vn-mascot-wobble {
  animation: vn-wobble 3s ease-in-out infinite;
}

@keyframes vn-idle {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes vn-droop {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(4px) rotate(-2deg); }
}
@keyframes vn-wobble {
  0%,100% { transform: rotate(0deg) translateY(0); }
  20%      { transform: rotate(-4deg) translateY(-4px); }
  40%      { transform: rotate(4deg) translateY(-6px); }
  60%      { transform: rotate(-3deg) translateY(-3px); }
  80%      { transform: rotate(2deg) translateY(-5px); }
}
@keyframes vn-pop {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* === ÍCONE CIRCULAR === */
.vn-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 26px;
}
.vn-icon-wrap svg { animation: vn-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.vn-icon-purple  { background: var(--vee-purple-pale); }
.vn-icon-success { background: var(--success-pale); }
.vn-icon-warning { background: var(--warning-pale); }

/* === CHECK ANIMADO === */
.vn-check-wrap {
  width: 52px; height: 52px;
  background: var(--success-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.vn-check-wrap svg { animation: vn-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

/* === BADGE DE STATUS === */
.vn-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.vn-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.vn-badge-success { background: var(--success-pale); color: var(--success); }
.vn-badge-warning { background: var(--warning-pale); color: var(--warning); }
.vn-badge-purple  { background: var(--vee-purple-pale); color: var(--vee-purple); }

/* === PASSOS === */
.vn-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.vn-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.vn-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--vee-purple-pale);
  color: var(--vee-purple);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.vn-step-text {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
}
.vn-step-text strong { color: var(--ink-primary); font-weight: 500; }

/* === ESTADOS === */
.vn-state { display: none; }
.vn-state.active { display: block; }

/* === TIPOGRAFIA === */
.vn-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.25;
  margin-bottom: 10px;
}
.vn-title-lg { font-size: 22px; }
.vn-title-md { font-size: 19px; }

.vn-description {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* === FORMULÁRIO === */
.vn-field-group { margin-bottom: 16px; }

.vn-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.vn-input-wrap { position: relative; }

.vn-input {
  width: 100%;
  height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.vn-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139,92,200,0.12);
}
.vn-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(200,64,64,0.10);
}
.vn-input-password { padding-right: 48px; }

.vn-toggle-senha {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.vn-toggle-senha:hover { color: var(--vee-purple); }

.vn-field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  display: none;
}
.vn-field-error.visible { display: block; }

.vn-global-error {
  background: var(--error-pale);
  border: 1px solid rgba(200,64,64,0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--error);
  margin-bottom: 16px;
  display: none;
}
.vn-global-error.visible { display: block; }

/* === DIVIDER === */
.vn-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* === FOOTER === */
.vn-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--ink-tertiary);
  text-align: center;
  line-height: 1.7;
  max-width: 420px;
}
.vn-footer a { color: inherit; text-decoration: none; }
.vn-footer a:hover { color: var(--vee-purple); }

/* === RATE LIMIT FEEDBACK === */
.vn-rate-limit {
  font-size: 12px;
  color: var(--ink-tertiary);
  text-align: center;
  margin-top: 8px;
  display: none;
}
.vn-rate-limit.visible { display: block; }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .vn-mascot-idle,
  .vn-mascot-celebrate,
  .vn-mascot-droop,
  .vn-mascot-wobble,
  .vn-spinner,
  .vn-btn-spinner,
  .vn-check-wrap svg,
  .vn-icon-wrap svg { animation: none !important; }

  body,
  .vn-card,
  .vn-input,
  .vn-btn { transition: none !important; }
}

/* === RESPONSIVO === */
@media (max-width: 480px) {
  .vn-card { border-radius: 16px; }
}
