/*
 * Benguet IDB Electronic Records - Full-Screen Authentication Portal
 * Modern split-panel design utilizing entire viewport
 * Color Palette: Navy (#080161), Goldenrod (#DBAA0F), Alice Blue (#E3EDF9), Carbon (#191919)
 */

/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
  /* Brand Colors */
  --navy: #080161;
  --navy-light: #0f0a88;
  --navy-dark: #050042;
  --navy-ultra: #020028;
  --gold: #DBAA0F;
  --gold-light: #f4c938;
  --gold-dark: #b88f0a;
  --alice: #E3EDF9;
  --alice-dark: #d4e3f5;
  --carbon: #191919;
  --carbon-light: #2f3241;
  
  /* Semantic Colors */
  --surface: #ffffff;
  --surface-hover: #f9fafb;
  --text-primary: var(--carbon);
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-focus: var(--navy);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(8, 1, 97, 0.06);
  --shadow-md: 0 4px 16px rgba(8, 1, 97, 0.08);
  --shadow-lg: 0 8px 32px rgba(8, 1, 97, 0.12);
  
  /* Typography */
  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  
  /* Spacing */
  --radius: 12px;
  --radius-lg: 16px;
  
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   FULL-SCREEN LAYOUT CONTAINER
   ======================================== */
.auth-container {
  height: 100vh;
  overflow: hidden;
}

.fullscreen-login {
  display: grid;
  grid-template-columns: 45% 55%;
  height: 100vh;
  overflow: hidden;
}

/* ========================================
   LEFT PANEL - BRAND & VISUAL
   ======================================== */
.brand-panel {
  position: relative;
  background: linear-gradient(165deg, var(--navy-ultra) 0%, var(--navy) 40%, var(--navy-light) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  overflow: hidden;
}

.brand-content {
  position: relative;
  z-index: 10;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* Brand Header */
.brand-header {
  text-align: center;
  animation: fadeInUp 0.8s var(--ease);
}

.seal-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  background: rgba(219, 170, 15, 0.12);
  border-radius: 50%;
  border: 3px solid rgba(219, 170, 15, 0.3);
  box-shadow: 0 0 0 12px rgba(219, 170, 15, 0.06);
}

.seal-large {
  width: 64px;
  height: 64px;
  color: var(--gold);
  filter: drop-shadow(0 4px 12px rgba(219, 170, 15, 0.4));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 18px;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeInUp 0.8s 0.2s var(--ease) backwards;
}

.feature-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.3s var(--ease);
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(219, 170, 15, 0.3);
  transform: translateX(8px);
}

.feature-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--gold);
  opacity: 0.9;
}

.feature-item h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
}

.feature-item p {
  font-size: 14px;
  opacity: 0.75;
  margin: 0;
  line-height: 1.5;
}

/* Brand Footer */
.brand-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  animation: fadeInUp 0.8s 0.4s var(--ease) backwards;
}

.security-badge-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(219, 170, 15, 0.15);
  border: 1px solid rgba(219, 170, 15, 0.3);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--gold-light);
  align-self: flex-start;
}

.security-badge-large svg {
  width: 16px;
  height: 16px;
}

.copyright {
  font-size: 13px;
  opacity: 0.6;
  margin: 0;
}

/* Decorative Gradients */
.gradient-overlay {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
}

.gradient-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--gold), transparent 60%);
  top: -200px;
  right: -200px;
  animation: float 25s ease-in-out infinite;
}

.gradient-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(227, 237, 249, 0.3), transparent 60%);
  bottom: -150px;
  left: -150px;
  animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -40px) scale(1.1); }
}

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

/* ========================================
   RIGHT PANEL - FORM
   ======================================== */
.form-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
}

.form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 80px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Top bar */
.form-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 40px;
}

.secure-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(8, 1, 97, 0.04);
  border: 1px solid rgba(8, 1, 97, 0.1);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.3px;
}

.secure-indicator svg {
  color: var(--navy);
}

/* Main form area */
.form-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.form-intro {
  margin-bottom: 48px;
  animation: fadeInUp 0.6s var(--ease);
}

.form-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--carbon);
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.form-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  max-width: 480px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeInUp 0.6s 0.1s var(--ease) backwards;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-forgot {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.link-forgot:hover {
  color: var(--navy-light);
  text-decoration: underline;
}

/* Input Group */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s var(--ease);
  z-index: 1;
}

.field-input {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 52px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.25s var(--ease);
}

.field-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.field-input:hover {
  border-color: #cbd5e1;
  background: var(--surface-hover);
}

.field-input:focus {
}

.input-group:has(.field-input:focus) .input-icon {
}

/* Checkbox */
.form-options {
  margin-top: -8px;
}

.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  cursor: pointer;
  accent-color: var(--navy);
}

.checkbox-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Sign In Button */
.btn-signin {
  width: 100%;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 28px;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  box-shadow: 0 8px 24px rgba(8, 1, 97, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-signin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.btn-signin span,
.btn-signin svg {
  position: relative;
  z-index: 1;
}

.btn-signin svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease);
}

.btn-signin:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(8, 1, 97, 0.28);
}

.btn-signin:hover::before {
  opacity: 0.15;
}

.btn-signin:hover svg {
  transform: translateX(4px);
}

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

/* Divider */
.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 24px;
  text-align: center;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-divider span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Secondary Actions */
.secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}

.link-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--navy);
  color: var(--navy);
  transform: translateX(4px);
}

.link-secondary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Bottom footer */
.form-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.legal-links a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE - TABLET & MOBILE
   ======================================== */
@media (max-width: 1200px) {
  .fullscreen-login {
    grid-template-columns: 42% 58%;
  }
  
  .brand-content {
    gap: 48px;
  }
  
  .form-container {
    padding: 40px 60px;
  }
}

@media (max-width: 1024px) {
  .fullscreen-login {
    grid-template-columns: 40% 60%;
  }
  
  .brand-panel {
    padding: 40px;
  }
  
  .brand-content {
    gap: 40px;
  }
  
  .seal-wrapper {
    width: 100px;
    height: 100px;
  }
  
  .seal-large {
    width: 52px;
    height: 52px;
  }
  
  .brand-title {
    font-size: 36px;
  }
  
  .brand-subtitle {
    font-size: 16px;
  }
  
  .form-container {
    padding: 36px 48px;
  }
  
  .form-title {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .fullscreen-login {
    grid-template-columns: 1fr;
  }
  
  .brand-panel {
    display: none;
  }
  
  .form-panel {
    background: linear-gradient(135deg, rgba(227, 237, 249, 0.4) 0%, var(--surface) 30%);
  }
  
  .form-container {
    padding: 32px 24px;
  }
  
  .form-title {
    font-size: 28px;
  }
  
  .form-description {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 24px 20px;
  }
  
  .form-topbar {
    margin-bottom: 32px;
  }
  
  .secure-indicator {
    font-size: 12px;
    padding: 8px 14px;
  }
  
  .form-title {
    font-size: 26px;
  }
  
  .field-input,
  .btn-signin {
    height: 52px;
  }
  
  .field-input {
    font-size: 16px; /* Prevents iOS zoom */
  }
}

/* ========================================
   ACCESSIBILITY & PREFERENCES
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .field-input,
  .link-secondary {
    border-width: 2px;
  }
}

/* Print */
@media print {
  .brand-panel,
  .gradient-overlay,
  .form-topbar,
  .secondary-actions,
  .form-bottom {
    display: none;
  }
}
