/* =====================================================================
   VEEVA ADMIN — CSS v0.2
   • Login redesenhado (Veeva em destaque com logo PNG)
   • Sidebar lateral esquerda colapsável (logo full ⇄ V-asa)
   • Mensagens contextuais (não mais "bem-vindo de volta")
   ===================================================================== */

:root {
  /* Paleta oficial */
  --coral-orange: #FF8E5C;
  --coral-pink:   #FF5C7F;
  --magenta-hot:  #E91E63;
  --cream:        #FFF4E8;
  --black:        #0E0D0C;
  --gray:         #7A7068;
  --white:        #FFFFFF;

  /* Sunset gradients */
  --gradient-sunset: linear-gradient(90deg, #FF8E5C 0%, #FF5C7F 50%, #E91E63 100%);
  --gradient-sunset-vertical: linear-gradient(180deg, #FF8E5C 0%, #FF5C7F 50%, #E91E63 100%);
  --gradient-sunset-radial: radial-gradient(ellipse at 30% 20%, #FFB088 0%, #FF5C7F 35%, #E91E63 70%, #8B1240 100%);

  /* Funcionais */
  --bg-page:        #FFF4E8;
  --bg-card:        #FFFFFF;
  --bg-input:       #FFFFFF;
  --bg-sidebar:     #0E0D0C;
  --border:         #E8DFD2;
  --border-focus:   #FF5C7F;
  --text-primary:   #0E0D0C;
  --text-secondary: #7A7068;
  --text-muted:     #A89E92;
  --error:          #E91E63;
  --success:        #2EAD7E;
  --warning:        #E8A23C;

  /* Sidebar */
  --sidebar-w-open:   240px;
  --sidebar-w-closed: 76px;
  --sidebar-bg:       #0E0D0C;
  --sidebar-text:     rgba(255, 255, 255, 0.78);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);

  /* Espacejamento */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Bordas */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(14, 13, 12, 0.06);
  --shadow-md: 0 4px 16px rgba(14, 13, 12, 0.08);
  --shadow-lg: 0 12px 32px rgba(14, 13, 12, 0.12);

  /* Transições */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
}

/* =================== RESET =================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Mulish', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }
a { color: var(--magenta-hot); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--coral-pink); }
input, select, textarea, button { font-family: inherit; }

/* =================== TIPOGRAFIA =================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Mulish', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.editorial { font-family: 'Cormorant', Georgia, serif; font-style: italic; font-weight: 400; }

.gradient-text {
  background: var(--gradient-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* =====================================================================
   AUTH (LOGIN / RECUPERAR / REDEFINIR) — REDESENHADO
   ===================================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-page);
  position: relative;
  overflow: hidden;
}

@media (min-width: 960px) {
  .auth-page { grid-template-columns: 1.05fr 1fr; }
}

/* === LADO ESQUERDO: marca em destaque (com logo PNG) === */
.auth-aside {
  display: none;
  position: relative;
  background: var(--gradient-sunset-radial);
  padding: var(--space-2xl);
  color: var(--white);
  overflow: hidden;
  min-height: 100vh;
}

@media (min-width: 960px) {
  .auth-aside { display: flex; flex-direction: column; justify-content: space-between; }
}

/* "Sol" decorativo respirando */
.auth-aside::before {
  content: '';
  position: absolute;
  top: -10%; right: -10%;
  width: 540px; height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 220, 0.4) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  animation: sunBreath 8s ease-in-out infinite;
}
.auth-aside::after {
  content: '';
  position: absolute;
  bottom: -15%; left: -10%;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 30, 99, 0.45) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
}

@keyframes sunBreath {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* Logo grande no aside */
.auth-aside-brand {
  position: relative;
  z-index: 2;
}

.auth-aside-brand img {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.25));
}

.auth-aside-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: auto 0;
}

.auth-aside-content .editorial {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-md);
}

.auth-aside-content h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-md);
}

.auth-aside-content p {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  max-width: 420px;
}

.auth-aside-footer {
  position: relative;
  z-index: 2;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* === LADO DIREITO: formulário === */
.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  min-height: 100vh;
}

.auth-form-card { width: 100%; max-width: 420px; }

/* Logo no topo (mobile only) */
.auth-form-logo-mobile {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-xl);
}
.auth-form-logo-mobile img {
  height: 48px;
  width: auto;
}
@media (min-width: 960px) { .auth-form-logo-mobile { display: none; } }

.auth-title { font-size: 1.625rem; margin-bottom: var(--space-xs); }
.auth-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: var(--space-xl); }

/* =================== FORMS =================== */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(255, 92, 127, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }
.form-help { font-size: 0.8rem; color: var(--text-secondary); margin-top: var(--space-xs); }

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* =================== BOTÕES =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-primary);
  transition: all var(--t-base);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-sunset);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.35);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--coral-pink);
  color: var(--magenta-hot);
}

.btn-block { width: 100%; }

/* =================== ALERTAS =================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  border-left: 3px solid;
}
.alert-erro    { background: #FCEBEF; color: #9C1845; border-color: var(--error); }
.alert-sucesso { background: #E5F4ED; color: #1B5E3F; border-color: var(--success); }
.alert-aviso   { background: #FCF3E0; color: #8C5A12; border-color: var(--warning); }
.alert-info    { background: #ECF1F7; color: #2C4A6E; border-color: #3B7BC9; }

.link-sutil { font-size: 0.85rem; color: var(--text-secondary); }
.link-sutil a { color: var(--magenta-hot); font-weight: 500; }

/* =====================================================================
   APP SHELL (LAYOUT INTERNO COM SIDEBAR LATERAL)
   ===================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w-open) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--t-base);
}

.app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-w-closed) 1fr;
}

/* === Sidebar === */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.sidebar-header {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 88px;
}

/* Logo full (expandida) e ícone (colapsada) */
.sidebar-logo-full,
.sidebar-logo-icon {
  height: 36px;
  width: auto;
}

.sidebar-logo-full { display: block; }
.sidebar-logo-icon { display: none; }

.app.sidebar-collapsed .sidebar-logo-full { display: none; }
.app.sidebar-collapsed .sidebar-logo-icon { display: block; height: 32px; }
.app.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: var(--space-lg) var(--space-sm);
}

/* Botão de toggle (X) */
.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--sidebar-hover-bg); color: var(--white); }
.app.sidebar-collapsed .sidebar-toggle { display: none; }

/* Botão flutuante de "expandir" quando colapsado */
.sidebar-reopen {
  display: none;
  position: absolute;
  top: 28px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 5;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}
.sidebar-reopen:hover { background: var(--cream); color: var(--magenta-hot); transform: scale(1.1); }
.app.sidebar-collapsed .sidebar-reopen { display: inline-flex; }

/* === Sidebar nav === */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 6px; }

.nav-section {
  padding: var(--space-md) var(--space-md) var(--space-xs);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.app.sidebar-collapsed .nav-section { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  margin: 0 var(--space-sm);
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
  position: relative;
}

.nav-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-active); }

.nav-item.active {
  background: var(--gradient-sunset);
  color: var(--white);
  box-shadow: 0 2px 12px rgba(233, 30, 99, 0.35);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.app.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  margin: 2px var(--space-md);
}
.app.sidebar-collapsed .nav-item-label { display: none; }

/* Tooltip ao hover quando colapsado */
.app.sidebar-collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--black);
  color: var(--white);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 100;
  pointer-events: none;
}

/* === Sidebar footer (usuário) === */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-sunset);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }

.sidebar-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-logout {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.sidebar-user-logout:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }

.app.sidebar-collapsed .sidebar-footer { justify-content: center; padding: var(--space-md) 0; }
.app.sidebar-collapsed .sidebar-user-info,
.app.sidebar-collapsed .sidebar-user-logout { display: none; }

/* =================== ÁREA PRINCIPAL =================== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* =================== CARDS =================== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.card-title { font-size: 1.5rem; margin-bottom: var(--space-sm); }
.card-tag {
  color: var(--text-secondary);
  font-family: 'Cormorant', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: var(--space-xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.stat {
  background: var(--bg-page);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.next-steps {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-page);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.next-steps strong { color: var(--text-primary); }
.next-steps ul { margin: var(--space-sm) 0 0 var(--space-md); line-height: 1.85; }

/* =================== RESPONSIVE =================== */
.topbar-mobile-toggle { display: none; }

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
    width: var(--sidebar-w-open);
    z-index: 100;
    transition: transform var(--t-base);
  }
  .app.sidebar-mobile-open .sidebar { transform: translateX(0); }
  .sidebar-reopen { display: none !important; }
  .topbar { padding: var(--space-md); }
  .content { padding: var(--space-md); }
  .topbar-mobile-toggle {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
  }
}

@media (max-width: 640px) {
  .auth-form-wrap { padding: var(--space-lg) var(--space-md); }
}
