/**
 * ============================================================
 *  ZAPTOU — Login Design System v3
 *  Layout profissional: desktop dividido, mobile empilhado
 * ============================================================
 */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --z-primary:        #ff5c00;
  --z-primary-dark:   #d94e00;
  --z-primary-light:  rgba(255, 92, 0, 0.08);
  --z-bg:             #faf5f2;
  --z-surface:        #ffffff;
  --z-text:           #1a1a2e;
  --z-text-secondary: #64748b;
  --z-text-muted:     #94a3b8;
  --z-border:         #e2e8f0;
  --z-radius:         20px;
  --z-radius-sm:      12px;
  --z-shadow:         0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  --z-shadow-lg:      0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --z-transition:     all 0.2s ease;
}

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

/* ── Page Layout ─────────────────────────────────────────── */
.login-page {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--z-bg);
  min-height: 100vh;
  display: flex;
}

/* ── Left Panel ──────────────────────────────────────────── */
.login-left {
  width: 480px;
  min-height: 100vh;
  background: var(--z-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
}

/* ── Right Panel ─────────────────────────────────────────── */
.login-right {
  flex: 1;
  background: linear-gradient(135deg, #ff6b35 0%, #d94e00 50%, #b84300 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.login-right-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 420px;
}

/* ── Back Button ─────────────────────────────────────────── */
.login-back {
  position: absolute;
  top: 32px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--z-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--z-transition);
}

.login-back:hover {
  color: var(--z-primary);
  background: var(--z-primary-light);
}

/* ── Logo ────────────────────────────────────────────────── */
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--z-primary), var(--z-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 16px rgba(255, 92, 0, 0.25);
}

.login-logo img {
  height: 32px;
  width: auto;
}

.login-logo .material-symbols-outlined {
  font-size: 28px;
  color: white;
}

/* ── Header ──────────────────────────────────────────────── */
.login-brand {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--z-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--z-text);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.9375rem;
  color: var(--z-text-secondary);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Badge ───────────────────────────────────────────────── */
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--z-primary-light);
  border: 1px solid rgba(255, 92, 0, 0.15);
  border-radius: 24px;
  color: var(--z-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  margin: 0 auto 20px;
}

/* ── Form ────────────────────────────────────────────────── */
.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--z-text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.9375rem;
  border: 1.5px solid var(--z-border);
  border-radius: var(--z-radius-sm);
  background: var(--z-surface);
  color: var(--z-text);
  outline: none;
  transition: var(--z-transition);
}

.form-control:focus {
  border-color: var(--z-primary);
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.1);
}

.form-control::placeholder {
  color: var(--z-text-muted);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--z-radius-sm);
  background: linear-gradient(135deg, var(--z-primary), var(--z-primary-dark));
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(255, 92, 0, 0.35);
  transition: var(--z-transition);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 92, 0, 0.4);
}

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

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* ── Error ───────────────────────────────────────────────── */
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: var(--z-radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-error .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

/* ── OTP ─────────────────────────────────────────────────── */
.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--z-radius-sm);
  border: 1.5px solid var(--z-border);
  background: var(--z-surface);
  color: var(--z-text);
  font-family: inherit;
  outline: none;
  transition: var(--z-transition);
}

.otp-input:focus {
  border-color: var(--z-primary);
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.1);
}

/* ── Links ───────────────────────────────────────────────── */
.login-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--z-primary);
  text-decoration: none;
  font-weight: 500;
}

.login-link:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────── */
.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--z-text-muted);
}

.login-footer a {
  color: var(--z-primary);
  text-decoration: none;
  font-weight: 500;
}

/* ── Resend Row ──────────────────────────────────────────── */
.resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 0.8125rem;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--z-primary);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.resend-btn:hover {
  text-decoration: underline;
}

.resend-timer {
  color: var(--z-text-muted);
}

/* ── Error Message (dynamic) ─────────────────────────────── */
.error-msg {
  font-size: 0.8125rem;
  color: #dc2626;
  margin-bottom: 16px;
  display: none;
  text-align: center;
  background: #fef2f2;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* ── Theme: Kitchen ──────────────────────────────────────── */
.login-page[data-theme="kitchen"] {
  --z-primary:        #f59e0b;
  --z-primary-dark:   #d97706;
  --z-primary-light:  rgba(245, 158, 11, 0.08);
  --z-bg:             #fffbeb;
}

.login-page[data-theme="kitchen"] .login-right {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
}

/* ── Theme: Driver ───────────────────────────────────────── */
.login-page[data-theme="driver"] {
  --z-primary:        #25d366;
  --z-primary-dark:   #128c7e;
  --z-primary-light:  rgba(37, 211, 102, 0.08);
  --z-bg:             #f0fdf4;
}

.login-page[data-theme="driver"] .login-right {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 50%, #075e54 100%);
}

/* ── Theme: Master ───────────────────────────────────────── */
.login-page[data-theme="master"] {
  --z-primary:        #3b82f6;
  --z-primary-dark:   #1d4ed8;
  --z-primary-light:  rgba(59, 130, 246, 0.08);
  --z-bg:             #f8fafc;
}

.login-page[data-theme="master"] .login-right {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* ── Responsive: Tablet ──────────────────────────────────── */
@media (max-width: 1024px) {
  .login-left {
    width: 420px;
    padding: 40px 40px;
  }
  
  .login-right {
    padding: 40px;
  }
}

/* ── Responsive: Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  .login-page {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-left {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .login-right {
    display: none;
  }

  .login-back {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 24px;
    padding: 8px 0;
  }

  .login-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-subtitle {
    margin-bottom: 28px;
  }

  .otp-container {
    gap: 8px;
    margin: 20px 0;
  }

  .otp-input {
    width: 44px;
    height: 52px;
    font-size: 1.125rem;
  }

  .btn-primary {
    height: 50px;
  }

  .login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--z-border);
  }
}

/* ── Responsive: Small Mobile ────────────────────────────── */
@media (max-width: 380px) {
  .login-left {
    padding: 24px 20px 40px;
  }

  .login-title {
    font-size: 1.35rem;
  }

  .otp-input {
    width: 40px;
    height: 48px;
    font-size: 1rem;
  }
}
