/* ============================================================
   Nova — Painel Franquia
   Refined White & Lead Login Stylesheet
   ============================================================ */

:root {
  /* Unified White & Lead Theme - Color Uniformity */
  --bg:          #f4f6f9;
  --surface:     #ffffff;
  
  /* Unified Deep Slate/Chumbo (Left panel & primary highlights) */
  --accent:      #1e293b; 
  --accent-soft: rgba(30, 41, 59, 0.08);
  --accent-hover: #0f172a;
  
  /* Slate Lead variants */
  --ink:         #0f172a;
  --ink-2:       #475569;
  --ink-3:       #94a3b8;
  --line:        #e2e8f0;
  
  /* Pantone Terracotta (Alert) */
  --terracotta:  #cc4e4e;
  
  --shadow-prm:  0 20px 40px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: 
    radial-gradient(circle at 10% 20%, rgba(83, 86, 90, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(35, 43, 47, 0.05) 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Auth Centered Container */
.auth-container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: min(1080px, 95vw);
  min-height: 640px;
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-prm), 0 1px 3px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  position: relative;
  animation: cardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   LEFT PANEL - VISUAL BRANDING
   ============================================================ */
.auth-visual {
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #ffffff;
  overflow: hidden;
}

/* Decorative background glowing orb */
.auth-visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* Animated geometric light details */
.auth-visual-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
  z-index: 0;
}

.brand-wrapper {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.brand-showcase {
  width: min(340px, 90%);
  height: 200px;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.25));
  animation: floatBrand 4s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

@keyframes floatBrand {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(1.65);
  transform-origin: center;
}

.brand-info {
  margin-top: 12px;
}

.brand-tagline {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 320px;
  line-height: 1.5;
  font-weight: 400;
}

/* ============================================================
   RIGHT PANEL - FORM
   ============================================================ */
.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  position: relative;
  z-index: 2;
}

.form-header {
  margin-bottom: 32px;
}

.form-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Styled Form Field (Modern Boxed Floating Label) */
.field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.field label {
  position: absolute;
  left: 16px;
  top: 18px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-3);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              font-size 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s;
  transform-origin: left top;
  padding: 0 4px;
}

.field input {
  width: 100%;
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Input Focus States */
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Float Label when focused or having content */
.field.is-focused label,
.field.has-value label {
  transform: translateY(-28px) scale(0.85);
  color: var(--accent);
  background-color: var(--surface);
  font-weight: 600;
}

/* Password field adjustment for icon */
.field-password input {
  padding-right: 50px;
}

/* Toggle Password Visibility Button */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
}

.password-toggle:hover {
  color: var(--accent);
  background-color: var(--accent-soft);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Autofill styling overrides */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--accent);
}

/* Form Helper Links */
.form-helpers {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.forgot-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--accent);
}

/* Primary Button Styling */
.btn {
  margin-top: 10px;
  appearance: none;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 14px var(--accent-soft);
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.2);
}

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

/* Spinner for Loading State */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn.is-loading .btn-spinner {
  display: block;
}

.btn.is-loading .btn-text {
  opacity: 0.9;
}

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

/* Beautiful Alert Box styling conforming to Terracotta alert design */
.error-msg {
  background: rgba(204, 78, 78, 0.08);
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: shakeError 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.success-msg {
  background: rgba(46, 111, 64, 0.08);
  border: 1px solid #2e6f40;
  color: #2e6f40;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: cardEntry 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes shakeError {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ============================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ============================================================ */
@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
    min-height: auto;
    width: min(480px, 92vw);
  }

  .auth-visual {
    padding: 36px 24px;
    height: 180px;
  }

  .brand-showcase {
    width: 72px;
    height: 72px;
  }

  .brand-wrapper {
    flex-direction: row;
    gap: 16px;
  }

  .brand-info {
    text-align: left;
    margin-top: 0;
  }

  .brand-headline {
    font-size: 1.3rem;
    margin-bottom: 2px;
  }

  .brand-tagline {
    font-size: 0.8rem;
  }

  .auth-form-side {
    padding: 40px 32px;
  }

  .form-header {
    margin-bottom: 24px;
  }

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

@media (max-width: 480px) {
  .auth-visual {
    height: 140px;
    padding: 24px 16px;
  }
  
  .brand-showcase {
    width: 54px;
    height: 54px;
  }
  
  .brand-headline {
    font-size: 1.15rem;
  }

  .brand-tagline {
    display: none;
  }
  
  .auth-form-side {
    padding: 32px 20px;
  }
  
  .field input {
    padding: 16px 14px;
  }
  
  .field label {
    left: 14px;
    top: 16px;
    font-size: 0.88rem;
  }

  .field.is-focused label,
  .field.has-value label {
    transform: translateY(-26px) scale(0.82);
  }
}
