:root {
  --brand-red:    #f22c35;
  --brand-red-dk: #c8222a;
  --brand-cream:  #fdf6ee;
  --text-dark:    #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --white:        #ffffff;
  --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);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--brand-cream);
  min-height: 100vh;
  display: flex;
}

/* ── Layout split ───────────────────────────────────────────── */
.login-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

.login-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

/* painel hero — ilustração */
.login-panel--hero {
  background-color: var(--brand-cream);
  background-image: url("../imagens/order-ahead-animate.svg");
  background-size: clamp(280px, 60%, 560px);
  background-position: center;
  background-repeat: no-repeat;
}

/* painel form — formulário */
.login-panel--form {
  background-color: var(--white);
  box-shadow: 4px 0 24px rgba(0,0,0,.06);
  max-width: 480px;
  width: 100%;
}

/* ── Card ───────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 360px;
}

.login-logo {
  display: block;
  width: 180px;
  height: 56px;
  background-image: url("../imagens/logo-horizontal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Campos ─────────────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

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

.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(242,44,53,.12);
}

.field input.is-invalid {
  border-color: var(--brand-red);
}

/* toggle mostrar/ocultar senha */
.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: color .2s;
}

.btn-toggle-pwd:hover { color: var(--text-dark); }

/* campo de senha — espaço para o botão */
input[type="password"],
input[type="text"].pwd-field {
  padding-right: 42px;
}

/* ── Campo senha: oculto por padrão, aparece com animação ──── */
.field--pwd {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height .35s ease, opacity .3s ease, margin-bottom .35s ease;
}

.field--pwd.field--pwd-visible {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 20px;
}

/* ── Alerta de erro inline ──────────────────────────────────── */
.login-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
  background: #fff1f1;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}

.login-alert i { font-size: 1rem; flex-shrink: 0; }

.login-alert--warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

/* ── Botão principal ────────────────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--white);
  background: var(--brand-red);
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  position: relative;
}

.btn-login:hover:not(:disabled)  { background: var(--brand-red-dk); }
.btn-login:active:not(:disabled) { transform: scale(.98); }
.btn-login:disabled               { opacity: .65; cursor: not-allowed; }

.btn-login .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.btn-login.loading .spinner    { display: inline-block; }
.btn-login.loading .btn-label  { opacity: .7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Link solicitar acesso ──────────────────────────────────── */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--brand-red);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover { text-decoration: underline; }

/* ── Modal solicitar acesso ─────────────────────────────────── */
.modal-content  { border: none; border-radius: 12px; box-shadow: var(--shadow-md); }
.modal-header   { border-bottom: 1px solid var(--border); padding: 20px 24px 16px; }
.modal-body     { padding: 20px 24px; }
.modal-footer   { border-top: 1px solid var(--border); padding: 16px 24px; }
.modal-title    { font-size: 1rem; font-weight: 700; color: var(--text-dark); }

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

  .login-panel--form {
    max-width: 100%;
    box-shadow: none;
  }
}

@media (max-width: 400px) {
  .login-panel--right { padding: 32px 20px; }
}
