/* ===== RESET & VARIABLES ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:       #1a3a5c;
  --primary-light: #2a5282;
  --accent:        #c9a96e;
  --accent-light:  #e8d5b0;
  --text-dark:     #1a1a2e;
  --text-mid:      #4a5568;
  --text-light:    #718096;
  --bg-white:      #ffffff;
  --bg-soft:       #f8f7f4;
  --border:        #e2ddd6;
  --error:         #c0392b;
  --error-bg:      #fdf3f2;
  --error-border:  #f5c6c0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.14);
  --radius:        8px;
  --radius-lg:     16px;
  --font-sans:     'Georgia', 'Times New Roman', serif;
  --font-body:     system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition:    0.22s ease;
}

html {
  font-size: 16px;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg-soft);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== LAYOUT ===== */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ===== BRAND PANEL (left) ===== */
.login-brand {
  position: relative;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem;
  overflow: hidden;
}

.brand-decoration {
  position: absolute;
  bottom: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.brand-decoration::before {
  content: '';
  position: absolute;
  top: -200px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 360px;
}

.brand-logo {
  margin-bottom: 2.5rem;
}

/* ===== LOGO IMAGE ===== */
.logo-img {
  height: auto;
  width: 100%;
  max-width: 200px;
  display: block;
  object-fit: contain;
}

.logo-img--inverted {
  filter: brightness(0) invert(1);
  max-width: 220px;
}

.brand-tagline {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
  margin-bottom: 2.5rem;
  font-family: var(--font-sans);
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
}

.feat-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feat-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

/* ===== MAIN PANEL (right) ===== */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(160deg, #eef2f8 0%, var(--bg-soft) 55%, #f0ece4 100%);
}

/* ===== CARD ===== */
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.5rem 2.25rem;
  box-shadow: var(--shadow-lg);
}

.card-logo {
  margin-bottom: 2rem;
}

.card-title {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.card-subtitle {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* ===== ERROR BOX ===== */
.error-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  color: var(--error);
  line-height: 1.5;
}

.error-box[hidden] {
  display: none;
}

.error-box svg {
  width: 18px;
  height: 18px;
  fill: var(--error);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== FORM ===== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.01em;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.9rem;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.field-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--text-light);
}

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 2.75rem 0 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg-soft);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

.field-input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

.field-input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.10);
}

.field-input:focus + .toggle-password {
  color: var(--primary-light);
}

/* ===== PASSWORD TOGGLE ===== */
.toggle-password {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-light);
  transition: color var(--transition), background var(--transition);
}

.toggle-password:hover {
  color: var(--primary);
  background: rgba(26, 58, 92, 0.06);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===== SUBMIT BUTTON ===== */
.btn-entrar {
  width: 100%;
  height: 50px;
  margin-top: 0.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-entrar:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 58, 92, 0.28);
}

.btn-entrar:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ===== CARD FOOTER ===== */
.card-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: color var(--transition);
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--transition);
}

.back-link:hover {
  color: var(--primary);
}

.back-link:hover svg {
  transform: translateX(-3px);
}

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

  .login-brand {
    display: none;
  }

  .login-main {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 3rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
  }

  .card-title {
    font-size: 1.4rem;
  }
}
