/* ═══════════════════════════════════════════
   AFS Gestão de Frota — Auth Pages
   ═══════════════════════════════════════════ */

:root {
  --teal:        #1B6FEB;
  --teal-light:  #3B8AF5;
  --teal-dark:   #1050C0;
  --navy:        #040E1A;
  --navy2:       #071629;
  --navy3:       #0D2035;
  --gray1:       #8FA3B1;
  --gray2:       #B8CDD6;
  --gray3:       #E2EDF1;
  --white:       #FFFFFF;
  --red:         #EF4444;
  --green:       #22C55E;
  --border:      rgba(27,111,235,0.22);
  --border-2:    rgba(27,111,235,0.40);
}

* { box-sizing:border-box; margin:0; padding:0; }

body {
  background: var(--navy);
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--gray3);
}

/* Skeleton */
#skeleton-loader {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:var(--navy); z-index:9999;
  display:flex; align-items:center; justify-content:center;
  transition:opacity .5s ease;
}
#skeleton-loader img { height:60px; animation:pulse 1.5s infinite; }
@keyframes pulse {
  0%   { transform:scale(.95); opacity:.7; }
  50%  { transform:scale(1.05); opacity:1; }
  100% { transform:scale(.95); opacity:.7; }
}
body.loaded #skeleton-loader { opacity:0; pointer-events:none; }

/* Layout */
.auth-container {
  width: 1040px;
  max-width: 96%;
  background: var(--navy2);
  border-radius: 16px;
  display: flex;
  box-shadow: 0 25px 60px rgba(0,0,0,.5);
  overflow: hidden;
  min-height: 540px;
  border: 1px solid var(--border);
}

/* ── Esquerda (Form) ── */
.auth-form {
  flex: 0 0 55%;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-header { text-align:center; margin-bottom:30px; }
.auth-logo   { height:56px; margin-bottom:18px; }
.auth-header h1 { font-size:26px; color:var(--white); font-weight:800; margin-bottom:6px; }
.auth-header p  { font-size:14px; color:var(--gray1); }

.form-row   { display:flex; gap:16px; margin-bottom:0; }
.form-group { margin-bottom:18px; flex:1; }

.form-label {
  display:block; font-size:11px; font-weight:700;
  color:var(--gray1); margin-bottom:7px;
  text-transform:uppercase; letter-spacing:.5px;
}
.form-label i { color:var(--teal-light); margin-right:5px; }

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--navy3);
  color: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(0,168,173,.15);
}
.form-input::placeholder { color:var(--gray1); }

.input-icon-wrapper { position:relative; }
.input-icon-wrapper i {
  position:absolute; right:14px; top:50%;
  transform:translateY(-50%);
  color:var(--gray1); cursor:pointer;
  transition: color .15s;
  z-index: 2;
}
.input-icon-wrapper i:hover { color:var(--teal-light); }

.form-actions {
  display:flex; justify-content:space-between;
  align-items:center; margin-bottom:22px; font-size:13px;
}
.form-actions a { color:var(--teal-light); text-decoration:none; font-weight:500; }
.form-actions a:hover { text-decoration:underline; }
.checkbox-group { display:flex; align-items:center; gap:8px; color:var(--gray2); }
.checkbox-group input[type="checkbox"] {
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  margin:0;
  border:1px solid rgba(143,163,177,.32);
  border-radius:6px;
  background:linear-gradient(180deg, rgba(24,34,49,.96) 0%, rgba(15,23,42,.98) 100%);
  color:#FFFFFF;
  display:inline-grid;
  place-content:center;
  cursor:pointer;
  box-sizing:border-box;
  flex-shrink:0;
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .12s ease;
}
.checkbox-group input[type="checkbox"]::before {
  content:"";
  width:5px;
  height:9px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) scale(0);
  transform-origin:center;
  transition:transform .14s ease;
  margin-top:-1px;
}
.checkbox-group input[type="checkbox"]:hover {
  border-color:rgba(59,138,245,.56);
  box-shadow:0 0 0 3px rgba(27,111,235,.10);
}
.checkbox-group input[type="checkbox"]:focus-visible {
  outline:none;
  border-color:rgba(59,138,245,.72);
  box-shadow:0 0 0 4px rgba(27,111,235,.14);
}
.checkbox-group input[type="checkbox"]:checked {
  background:linear-gradient(135deg, #3B82F6 0%, #1B6FEB 100%);
  border-color:#3B82F6;
  box-shadow:0 10px 24px rgba(27,111,235,.18), 0 0 0 3px rgba(27,111,235,.14);
}
.checkbox-group input[type="checkbox"]:checked::before {
  transform:rotate(45deg) scale(1);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
a[class*="btn"] {
  text-decoration: none !important;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  margin-top: 6px;
  font-family: inherit;
  letter-spacing: .3px;
}
.btn-submit:hover {
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27,111,235,.3);
}

.auth-footer { text-align:center; margin-top:24px; font-size:14px; color:var(--gray1); }
.auth-footer a { color:var(--teal-light); text-decoration:none; font-weight:600; }
.auth-footer a:hover { text-decoration:underline; }

/* ── Direita (Info) ── */
.auth-info {
  flex: 0 0 45%;
  background: linear-gradient(160deg, var(--navy3) 0%, rgba(27,111,235,.18) 100%);
  border-left: 1px solid var(--border);
  padding: 52px 48px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Detalhe decorativo */
.auth-info::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(27,111,235,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.auth-info::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(27,111,235,.15) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-info-content { position: relative; z-index:1; }

.info-icon { margin-bottom:20px; }
.info-icon img { height:56px; max-width:100%; object-fit:contain; filter:brightness(1.1); }

.info-title {
  font-size:22px; font-weight:800; margin-bottom:10px;
  color:var(--white); line-height:1.2;
}
.info-desc {
  font-size:13px; line-height:1.65; margin-bottom:28px;
  color:var(--gray2);
}
.info-list { list-style:none; text-align:left; width:100%; }
.info-list li {
  margin-bottom:12px; font-size:13px;
  display:flex; align-items:center; gap:10px; color:var(--gray2);
}
.info-list li i {
  background: rgba(27,111,235,.2);
  width:26px; height:26px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; font-size:11px;
  color:var(--teal-light); flex-shrink:0;
}

/* Divisor decorativo */
.info-divider {
  width:40px; height:3px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal-light));
  border-radius:9px; margin:0 auto 20px;
}

/* ── Voltar btn ── */
.back-btn {
  position:absolute; top:24px; left:24px;
  width:38px; height:38px;
  background:var(--navy3); color:var(--gray2);
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; text-decoration:none;
  font-size:16px; transition:.2s;
  border:1px solid var(--border);
}
.back-btn:hover { border-color:var(--teal-light); color:var(--teal-light); }

/* ── Alertas ── */
.auth-alert {
  padding:10px 14px; border-radius:8px;
  font-size:13px; margin-bottom:16px;
  display:flex; align-items:center; gap:8px;
}
.auth-alert.error   { background:rgba(239,68,68,.1);  border:1px solid rgba(239,68,68,.3);  color:var(--red); }
.auth-alert.success { background:rgba(34,197,94,.1);  border:1px solid rgba(34,197,94,.3);  color:var(--green); }

/* ── Responsive ── */
@media (max-width:900px) {
  .auth-form { flex: 0 0 58%; padding: 40px 36px; }
  .auth-info  { flex: 0 0 42%; padding: 40px 28px; }
}
@media (max-width:768px) {
  body {
    padding: 16px;
  }
  .auth-container {
    flex-direction:column;
    max-width: 100%;
    min-height: 0;
  }
  .auth-info { display:none; }
  .form-row { flex-direction:column; gap:0; }
  .auth-form { padding:36px 24px; }
  .btn-submit,
  .input-icon-wrapper i,
  .back-btn {
    min-height: 44px;
  }
}
@media (max-width:480px) {
  body {
    padding: 12px;
  }
  .auth-form {
    padding: 28px 18px;
  }
  .auth-header h1 {
    font-size: 22px;
  }
  .auth-header p,
  .auth-footer {
    font-size: 13px;
  }
  .auth-logo,
  .info-icon img {
    height: 48px;
  }
  .form-input,
  .btn-submit {
    font-size: 14px;
  }
}
@media (max-width:320px) {
  body {
    padding: 10px;
  }
  .auth-form {
    padding: 24px 14px;
  }
}

/* ── Theme Toggle Btn ── */
.theme-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 38px;
  height: 38px;
  background: var(--navy3);
  color: var(--gray2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 16px;
  transition: .2s;
  border: 1px solid var(--border);
  cursor: pointer;
  z-index: 100;
}
.theme-toggle-btn:hover {
  border-color: var(--teal-light);
  color: var(--teal-light);
}

/* ── Tema Claro (Light Theme) ── */
[data-theme="light"] {
  --navy:        #F3F6FA;
  --navy2:       #FFFFFF;
  --navy3:       #F8FAFC;
  --gray1:       #64748B;
  --gray2:       #475569;
  --gray3:       #1E293B;
  --white:       #0F172A;
  --border:      rgba(0,0,0,0.1);
  --border-2:    rgba(0,0,0,0.15);
}

[data-theme="light"] .auth-info {
  background: linear-gradient(160deg, #E2E8F0 0%, rgba(27,111,235,.1) 100%);
  color: var(--white);
}

[data-theme="light"] .auth-info::before,
[data-theme="light"] .auth-info::after {
  background: radial-gradient(circle, rgba(27,111,235,.1) 0%, transparent 70%);
}

[data-theme="light"] .info-title,
[data-theme="light"] .auth-header h1 {
  color: var(--white);
}

[data-theme="light"] .checkbox-group input[type="checkbox"]:not(:checked) {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border-color: rgba(0,0,0,0.2);
  color: transparent;
}

[data-theme="light"] #skeleton-loader {
  background: #F3F6FA;
}

