/* ═══════════════════════════════════════════════════════════════════
   auth.css — Estilos da tela de login (LoginScreen).
   Design system: Archivo, monocromático, tokens --mc-* e --c-*
   Segue o mesmo padrão visual do autoload-screen e mc.css.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tela raiz ─────────────────────────────────────────────────── */
.login-screen {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  min-height:      100dvh;
  width:           100%;
  background:      #000;
  font-family:     'Archivo', 'Inter', system-ui, sans-serif;
  padding:         24px 16px;
  box-sizing:      border-box;
  animation:       mc-fade-in 0.3s ease;
}

/* ── Logo ──────────────────────────────────────────────────────── */
.login-logo {
  display:         flex;
  align-items:     center;
  gap:             12px;
  margin-bottom:   40px;
}

.login-logo-icon {
  width:           40px;
  height:          40px;
  border-radius:   10px;
  background:      #111;
  border:          1px solid rgba(255,255,255,0.11);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       18px;
  color:           rgba(255,255,255,0.80);
}

.login-logo-text {
  font-family:     'Archivo', sans-serif;
  font-size:       22px;
  font-weight:     400;
  letter-spacing:  -0.02em;
  color:           rgba(255,255,255,0.55);
  line-height:     1;
}

.login-logo-text b {
  font-weight:  700;
  color:        rgba(255,255,255,0.90);
}

/* ── Card ──────────────────────────────────────────────────────── */
.login-card {
  width:         100%;
  max-width:     400px;
  background:    #111;
  border:        1px solid rgba(255,255,255,0.11);
  border-radius: 12px;
  padding:       36px 32px 28px;
  box-sizing:    border-box;
}

/* ── Header do card ─────────────────────────────────────────────── */
.login-card-header {
  text-align:    center;
  margin-bottom: 28px;
}

.login-lock-icon {
  width:           44px;
  height:          44px;
  border-radius:   50%;
  background:      rgba(255,255,255,0.06);
  border:          1px solid rgba(255,255,255,0.10);
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  font-size:       18px;
  color:           rgba(255,255,255,0.55);
  margin-bottom:   16px;
}

.login-title {
  font-family:    'Archivo', sans-serif;
  font-size:      20px;
  font-weight:    600;
  letter-spacing: -0.02em;
  color:          rgba(255,255,255,0.90);
  margin:         0 0 6px;
  line-height:    1.2;
}

.login-subtitle {
  font-size:   13px;
  color:       rgba(255,255,255,0.40);
  margin:      0;
  line-height: 1.4;
}

/* ── Formulário ─────────────────────────────────────────────────── */
.login-form {
  display:        flex;
  flex-direction: column;
  gap:            16px;
}

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

.login-label {
  font-size:      11px;
  font-weight:    600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color:          rgba(255,255,255,0.40);
}

/* ── Input wrap (para botão de toggle) ─────────────────────────── */
.login-input-wrap {
  position: relative;
}

.login-input {
  width:          100%;
  padding:        11px 40px 11px 14px;
  background:     #000;
  border:         1px solid rgba(255,255,255,0.14);
  border-radius:  7px;
  color:          rgba(255,255,255,0.90);
  font-family:    'JetBrains Mono', 'Courier New', monospace;
  font-size:      15px;
  letter-spacing: 0.05em;
  outline:        none;
  transition:     border-color 0.15s, box-shadow 0.15s;
  box-sizing:     border-box;
  -webkit-appearance: none;
}

.login-input::placeholder {
  color:          rgba(255,255,255,0.18);
  letter-spacing: 0.05em;
  font-family:    'JetBrains Mono', monospace;
}

.login-input:focus {
  border-color: rgba(255,255,255,0.30);
  box-shadow:   0 0 0 3px rgba(255,255,255,0.05);
}

.login-input:disabled {
  opacity: 0.45;
  cursor:  not-allowed;
}

.login-input--error {
  border-color: rgba(224, 112, 112, 0.55) !important;
  box-shadow:   0 0 0 3px rgba(224, 112, 112, 0.08) !important;
}

/* ── Toggle senha ───────────────────────────────────────────────── */
.login-toggle-pass {
  position:   absolute;
  right:      12px;
  top:        50%;
  transform:  translateY(-50%);
  background: none;
  border:     none;
  color:      rgba(255,255,255,0.30);
  cursor:     pointer;
  padding:    4px;
  font-size:  13px;
  line-height: 1;
  transition: color 0.15s;
}

.login-toggle-pass:hover {
  color: rgba(255,255,255,0.65);
}

/* ── Mensagem de erro ───────────────────────────────────────────── */
.login-error {
  display:       flex;
  align-items:   flex-start;
  gap:           0;
  padding:       10px 13px;
  background:    rgba(224, 112, 112, 0.08);
  border:        1px solid rgba(224, 112, 112, 0.22);
  border-radius: 7px;
  font-size:     12.5px;
  color:         #e07070;
  line-height:   1.45;
  animation:     login-shake 0.35s ease;
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(3px); }
}

/* ── Botão de submit ────────────────────────────────────────────── */
.login-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  width:           100%;
  padding:         12px 20px;
  background:      rgba(255,255,255,0.90);
  border:          1px solid rgba(255,255,255,0.90);
  border-radius:   7px;
  color:           #000;
  font-family:     'Archivo', sans-serif;
  font-size:       14px;
  font-weight:     600;
  letter-spacing:  0.01em;
  cursor:          pointer;
  transition:      background 0.15s, opacity 0.15s, transform 0.1s;
  margin-top:      4px;
  -webkit-appearance: none;
}

.login-btn:hover:not(:disabled) {
  background: #fff;
}

.login-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.login-btn:disabled {
  opacity: 0.38;
  cursor:  not-allowed;
}

/* ── Spinner no botão ───────────────────────────────────────────── */
.login-spinner {
  display:       inline-block;
  width:         14px;
  height:        14px;
  border:        2px solid rgba(0,0,0,0.20);
  border-top:    2px solid #000;
  border-radius: 50%;
  animation:     login-spin 0.7s linear infinite;
  flex-shrink:   0;
}

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

/* ── Rodapé do card ─────────────────────────────────────────────── */
.login-card-footer {
  margin-top:   24px;
  padding-top:  20px;
  border-top:   1px solid rgba(255,255,255,0.07);
  text-align:   center;
  font-size:    11.5px;
  color:        rgba(255,255,255,0.25);
  display:      flex;
  align-items:  center;
  justify-content: center;
  gap:          2px;
}

/* ── Botão Sair no Header ───────────────────────────────────────── */
.header-logout-btn {
  color:      rgba(255,255,255,0.40) !important;
  transition: color 0.15s, opacity 0.15s !important;
}

.header-logout-btn:hover:not(:disabled) {
  color: rgba(224, 112, 112, 0.85) !important;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS — Mobile-first
   ════════════════════════════════════════════════════════════════════ */

/* ── ≤768 px — Tablet portrait ────────────────────────────────────── */
@media (max-width: 768px) {
  .login-screen { padding: 20px 16px; }

  .login-card {
    max-width:    440px;
    padding:      32px 28px 24px;
  }

  /* Inputs: touch-friendly */
  .login-input { padding: 12px 40px 12px 14px; font-size: 16px; min-height: 44px; }

  /* Botão: touch target ≥44px */
  .login-btn { padding: 13px 20px; min-height: 44px; font-size: 15px; }
}

/* ── ≤480 px — Mobile ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Tela: padding mínimo */
  .login-screen { padding: 16px 12px; justify-content: flex-start; padding-top: 40px; }

  /* Logo: menor */
  .login-logo        { margin-bottom: 28px; gap: 10px; }
  .login-logo-icon   { width: 34px; height: 34px; font-size: 15px; border-radius: 8px; }
  .login-logo-text   { font-size: 18px; }

  /* Card: ocupa quase toda a largura */
  .login-card {
    padding:       24px 18px 20px;
    border-radius: 10px;
    max-width:     100%;
  }

  /* Header do card */
  .login-card-header  { margin-bottom: 22px; }
  .login-lock-icon    { width: 40px; height: 40px; font-size: 16px; margin-bottom: 12px; }
  .login-title        { font-size: 18px; }
  .login-subtitle     { font-size: 12px; }

  /* Formulário */
  .login-form         { gap: 14px; }
  .login-label        { font-size: 10px; }

  /* Input: touch ≥44px, fonte ≥16px (evita zoom iOS) */
  .login-input {
    padding:    12px 40px 12px 14px;
    font-size:  16px;     /* ≥16px evita auto-zoom no iOS */
    min-height: 44px;
    border-radius: 8px;
  }

  /* Toggle senha */
  .login-toggle-pass { right: 10px; font-size: 14px; padding: 6px; }

  /* Botão: touch ≥44px */
  .login-btn {
    padding:    13px 16px;
    min-height: 44px;
    font-size:  15px;
    border-radius: 8px;
  }

  /* Mensagem de erro */
  .login-error { font-size: 12px; padding: 9px 12px; }

  /* Footer do card */
  .login-card-footer { margin-top: 18px; padding-top: 16px; font-size: 11px; }
}

/* ── ≤360 px — Small mobile ───────────────────────────────────────── */
@media (max-width: 360px) {
  .login-screen { padding-top: 24px; }

  .login-card   { padding: 20px 14px 16px; }
  .login-title  { font-size: 16px; }
  .login-subtitle { font-size: 11px; }

  /* Mesmo em telas minúsculas, manter min-height de 44px nos inputs */
  .login-input { min-height: 44px; font-size: 16px; padding: 11px 36px 11px 12px; }
  .login-btn   { min-height: 44px; font-size: 14px; }

  .login-logo-text { font-size: 16px; }
}

/* ── Touch: ajustes de interação ─────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Evitar estados hover no mobile */
  .login-btn:hover:not(:disabled)    { background: rgba(255,255,255,0.90); }
  .login-toggle-pass:hover           { color: rgba(255,255,255,0.30); }

  /* Botão de logout no header */
  .header-logout-btn:hover:not(:disabled) { color: rgba(255,255,255,0.40) !important; }

  /* Touch target mínimo para toggle de senha */
  .login-toggle-pass { padding: 10px; min-width: 40px; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
    top: 50%; transform: translateY(-50%); right: 4px;
  }
}
