/* ============================================================
   Z·Apply — Auth Pages CSS
   Identidade Visual: Verde WhatsApp + Branco + Dark Green
   ============================================================ */

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

:root {
  --green-primary:  #25D366;
  --green-dark:     #128C7E;
  --green-deeper:   #0D5C3A;
  --green-bg:       #0A4A2E;
  --white:          #FFFFFF;
  --gray-50:        #F9FAFB;
  --gray-100:       #F3F4F6;
  --gray-200:       #E5E7EB;
  --gray-400:       #9CA3AF;
  --gray-500:       #6B7280;
  --gray-700:       #374151;
  --gray-900:       #111827;
  --red-500:        #EF4444;
  --red-50:         #FEF2F2;
  --red-200:        #FECACA;
  --blue-500:       #3B82F6;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.14);
  --transition:     .2s ease;
  --font:           'Inter', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────
   SCREENS — SPA Navigation
────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
}

/* Slide transition */
.screen.slide-in {
  animation: slideIn .3s ease forwards;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ──────────────────────────────────────
   SPLIT LAYOUT
────────────────────────────────────── */
.split-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ──────────────────────────────────────
   BRAND PANEL (Left)
────────────────────────────────────── */
.brand-panel {
  flex: 0 0 480px;
  background: linear-gradient(160deg, var(--green-bg) 0%, var(--green-deeper) 40%, var(--green-dark) 100%);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.brand-panel::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(37, 211, 102, .08);
  pointer-events: none;
}

.brand-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(37, 211, 102, .06);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 36px;
  height: 100%;
}

.brand-content.centered {
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

.logo-icon.small {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.logo-z {
  font-size: 26px;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -1px;
}

.logo-icon.small .logo-z {
  font-size: 18px;
}

.logo-bolt {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.dot {
  color: var(--green-primary);
}

.logo-tag {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  margin-top: 2px;
  letter-spacing: .2px;
}

/* Brand Headline */
.brand-headline h2 {
  font-size: 30px;
  font-weight: 800;
  color: white;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.brand-headline p {
  margin-top: 10px;
  font-size: 15px;
  color: rgba(255,255,255,.7);
  font-weight: 400;
}

.highlight {
  color: var(--green-primary);
}

/* ──────────────────────────────────────
   CHAT MOCKUP
────────────────────────────────────── */
.chat-mockup {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(8px);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: var(--green-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chat-header strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green-primary);
  border-radius: 50%;
  margin-left: 4px;
  box-shadow: 0 0 0 2px rgba(37,211,102,.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(37,211,102,.3); }
  50%       { box-shadow: 0 0 0 5px rgba(37,211,102,.1); }
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  max-height: 110px;
  overflow: hidden;
}

.msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  animation: msgAppear .4s ease;
}

@keyframes msgAppear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg.incoming {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}

.msg.outgoing {
  background: var(--green-primary);
  color: white;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  width: fit-content;
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,.6);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Stats */
.brand-stats {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat {
  flex: 1;
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,.1);
}

.stat:last-child { border-right: none; }

.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--green-primary);
  line-height: 1;
}

.stat span {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Benefits List */
.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.benefit-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.benefit-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
}

.benefit-item span {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  line-height: 1.4;
}

/* Social Proof */
.social-proof-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
}

/* Lock Illustration */
.lock-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.lock-circle {
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-illustration p {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  max-width: 280px;
  line-height: 1.5;
}

.centered-text {
  text-align: center;
}

/* ──────────────────────────────────────
   FORM PANEL (Right)
────────────────────────────────────── */
.form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: white;
  overflow-y: auto;
}

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

/* Mobile Logo */
.form-logo-mobile {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.form-logo-mobile .logo-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.4px;
}

.form-logo-mobile .dot {
  color: var(--green-primary);
}

/* Form Header */
.form-header {
  margin-bottom: 28px;
}

.form-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.5px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.form-header p {
  font-size: 14px;
  color: var(--gray-500);
}

.form-back {
  margin-bottom: 12px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--gray-500) !important;
}

.back-btn:hover {
  color: var(--green-deeper) !important;
}

/* ──────────────────────────────────────
   FORM FIELDS
────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  color: var(--gray-400);
  pointer-events: none;
  flex-shrink: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .12);
}

input.error,
select.error {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

input.valid {
  border-color: var(--green-primary);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--gray-700); }

/* Select wrapper */
.select-wrapper select {
  padding-right: 36px;
}

.select-chevron {
  position: absolute;
  right: 12px;
  color: var(--gray-400);
  pointer-events: none;
}

/* Password Strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  transition: width .3s ease, background .3s ease;
}

.strength-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 1px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--green-primary);
  border-color: var(--green-primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

/* Field Errors */
.field-error {
  font-size: 12px;
  color: var(--red-500);
  min-height: 16px;
  font-weight: 500;
}

/* Alert */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.alert-error {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  color: var(--red-500);
}

/* Forgot link */
.forgot-link {
  font-size: 12px !important;
  color: var(--gray-400) !important;
  font-weight: 400 !important;
}

.forgot-link:hover {
  color: var(--green-deeper) !important;
}

/* Link inline */
.link-inline {
  color: var(--green-darker, var(--green-deep, #0D5C3A));
  text-decoration: underline;
  font-weight: 500;
}

/* ──────────────────────────────────────
   BUTTONS
────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .1px;
  box-shadow: 0 4px 16px rgba(37,211,102,.25);
}

.btn-primary:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(37,211,102,.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: var(--green-deeper);
  border: 2px solid var(--green-primary);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-outline:hover {
  background: rgba(37,211,102,.06);
}

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

.btn-google {
  width: 100%;
  padding: 12px 20px;
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--green-deeper);
  transition: color var(--transition);
  padding: 0;
}

.link-btn:hover {
  color: var(--green-primary);
  text-decoration: underline;
}

/* Spinner */
.spin {
  animation: spin .8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Loading / success states inside button */
.btn-text, .btn-loading, .btn-success {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.shake {
  animation: shake .4s ease;
}

/* ──────────────────────────────────────
   DIVIDER
────────────────────────────────────── */
.divider {
  position: relative;
  text-align: center;
  margin: 18px 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gray-200);
  transform: translateY(-50%);
}

.divider span {
  position: relative;
  background: white;
  padding: 0 12px;
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 500;
}

/* ──────────────────────────────────────
   SWITCH SCREEN LINK
────────────────────────────────────── */
.switch-screen {
  text-align: center;
  font-size: 13.5px;
  color: var(--gray-500);
  margin-top: 20px;
}

/* ──────────────────────────────────────
   SUCCESS STATE
────────────────────────────────────── */
.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 20px 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.3);
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-state h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.3px;
}

.success-state p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  max-width: 320px;
}

.email-sent-to {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  width: 100%;
}

.mt-16 { margin-top: 16px; }

/* ──────────────────────────────────────
   RESPONSIVE
────────────────────────────────────── */
@media (max-width: 768px) {
  .brand-panel {
    display: none;
  }

  .form-panel {
    padding: 32px 24px;
    align-items: flex-start;
    padding-top: 48px;
  }

  .form-container {
    max-width: 100%;
  }

  .form-logo-mobile {
    display: flex;
  }

  .fields-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .brand-panel {
    flex: 0 0 380px;
    padding: 40px 32px;
  }

  .brand-headline h2 {
    font-size: 24px;
  }
}
