/* FABRIONE — Sistema de Gestão | Tela de Login
   Paleta: branco, azul, cinza e laranja */
:root {
  --fb-white: #ffffff;
  --fb-blue-900: #0b3b6f;
  --fb-blue-700: #14508f;
  --fb-blue-600: #1a63b0;
  --fb-blue-500: #2378d1;
  --fb-blue-100: #e8f1fb;
  --fb-gray-900: #202632;
  --fb-gray-700: #4b5563;
  --fb-gray-500: #7b8794;
  --fb-gray-300: #cbd2d9;
  --fb-gray-100: #f2f4f7;
  --fb-orange-600: #e8590c;
  --fb-orange-500: #f2760f;
  --fb-orange-100: #fff1e6;

  --fb-radius-sm: 8px;
  --fb-radius-md: 14px;
  --fb-radius-lg: 22px;

  --fb-shadow-md: 0 10px 30px rgba(11, 59, 111, 0.12);
  --fb-shadow-lg: 0 24px 60px rgba(11, 59, 111, 0.18);

  --fb-transition: 200ms ease;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--fb-gray-100);
  color: var(--fb-gray-900);
  -webkit-font-smoothing: antialiased;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* ===== Painel de marca (esquerda) ===== */
.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  background: linear-gradient(155deg, var(--fb-blue-900) 0%, var(--fb-blue-700) 55%, var(--fb-blue-600) 100%);
  color: var(--fb-white);
  overflow: hidden;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  background: var(--fb-orange-500);
}

.brand-panel::before {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -140px;
}

.brand-panel::after {
  width: 300px;
  height: 300px;
  bottom: -120px;
  left: -80px;
  background: var(--fb-white);
  opacity: 0.06;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
}

.brand-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-content {
  z-index: 1;
  max-width: 460px;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--fb-white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.brand-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fb-orange-500);
}

.brand-content h1 {
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 16px;
}

.brand-content p {
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

.brand-features {
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-features li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.brand-features .check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fb-orange-500);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-features .check svg {
  width: 12px;
  height: 12px;
}

.brand-footer {
  z-index: 1;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

/* ===== Painel de formulário (direita) ===== */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fb-white);
  padding: 40px 32px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .mobile-logo {
  display: none;
}

.login-card h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--fb-gray-900);
  margin-bottom: 6px;
}

.login-card .subtitle {
  font-size: 14.5px;
  color: var(--fb-gray-500);
  margin-bottom: 32px;
}

.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fb-gray-700);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--fb-gray-300);
  border-radius: var(--fb-radius-sm);
  background: var(--fb-white);
  transition: border-color var(--fb-transition), box-shadow var(--fb-transition);
}

.input-wrap:focus-within {
  border-color: var(--fb-blue-500);
  box-shadow: 0 0 0 4px var(--fb-blue-100);
}

.input-wrap .icon {
  width: 18px;
  height: 18px;
  margin-left: 14px;
  color: var(--fb-gray-500);
  flex-shrink: 0;
}

.input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 12px;
  font-size: 14.5px;
  color: var(--fb-gray-900);
  font-family: inherit;
}

.input-wrap .toggle-pass {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fb-gray-500);
  padding: 0 14px;
  display: flex;
  align-items: center;
}

.input-wrap .toggle-pass svg {
  width: 18px;
  height: 18px;
}

.field-error {
  display: none;
  color: #d43b1c;
  font-size: 12.5px;
  margin-top: 6px;
}

.field-group.error .input-wrap {
  border-color: #d43b1c;
}

.field-group.error .field-error {
  display: block;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  font-size: 13.5px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fb-gray-700);
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--fb-blue-600);
  cursor: pointer;
}

.forgot-link {
  color: var(--fb-blue-600);
  font-weight: 600;
  text-decoration: none;
}

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

.btn-login {
  width: 100%;
  border: none;
  border-radius: var(--fb-radius-sm);
  background: var(--fb-orange-600);
  color: var(--fb-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 14px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--fb-transition), transform var(--fb-transition), box-shadow var(--fb-transition);
  box-shadow: var(--fb-shadow-md);
}

.btn-login:hover {
  background: var(--fb-orange-500);
  transform: translateY(-1px);
}

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

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--fb-white);
  border-radius: 50%;
  display: none;
  animation: fb-spin 0.7s linear infinite;
}

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

.btn-login.loading .btn-label {
  opacity: 0.85;
}

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

.form-alert {
  display: none;
  align-items: center;
  gap: 10px;
  background: #fdecea;
  border: 1px solid #f3b7ab;
  color: #b3271a;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: var(--fb-radius-sm);
  margin-bottom: 18px;
}

.form-alert.show {
  display: flex;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fb-gray-500);
  font-size: 12.5px;
  margin: 26px 0 20px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--fb-gray-300);
}

.support-row {
  text-align: center;
  font-size: 13px;
  color: var(--fb-gray-500);
}

.support-row a {
  color: var(--fb-blue-600);
  font-weight: 600;
  text-decoration: none;
}

.support-row a:hover {
  text-decoration: underline;
}

/* ===== Responsivo ===== */
@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .login-card .mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
  }

  .login-card .mobile-logo img {
    height: 42px;
  }

  .form-panel {
    padding: 32px 20px;
    background: var(--fb-gray-100);
  }

  .login-card {
    background: var(--fb-white);
    padding: 32px 24px;
    border-radius: var(--fb-radius-lg);
    box-shadow: var(--fb-shadow-lg);
  }
}

@media (max-width: 420px) {
  .login-card h2 {
    font-size: 22px;
  }
}
