/* ══════════════════════════════════════════════════════════
   XAHICO Automation Platform - Enterprise Login
   ══════════════════════════════════════════════════════════ */

:root {
  /* Google Colors */
  --google-blue: #4285F4;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;
  
  /* UI Colors */
  --primary: #4285F4;
  --primary-dark: #3367D6;
  --primary-light: #5A9BFF;
  
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-tertiary: #80868b;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e8eaed;
  
  --border: #dadce0;
  --border-focus: #4285F4;
  
  --error: #d93025;
  --error-bg: #fce8e6;
  --error-border: #f28b82;
  
  --info: #4285F4;
  --info-bg: #e8f0fe;
  --info-border: #aecbfa;
  
  --success: #34A853;
  
  /* Fonts */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.15);
  --shadow-md: 0 2px 8px 0 rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 4px 16px 0 rgba(60, 64, 67, 0.15);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   BACKGROUND
   ══════════════════════════════════════════════════════════ */

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e8eaed 100%);
}

.gradient-overlay {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(66, 133, 244, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(52, 168, 83, 0.08) 0%, transparent 50%);
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTAINER
   ══════════════════════════════════════════════════════════ */

.container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════
   HERO PANEL (LEFT)
   ══════════════════════════════════════════════════════════ */

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;
  background: var(--bg-primary);
}

.hero-content {
  max-width: 520px;
  animation: fade-in-up 0.6s ease both;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Section */
.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.logo-image {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Hero Title */
.hero-title {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.title-line {
  display: block;
}

/* Hero Description */
.hero-description {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* Feature List Hero */
.feature-list-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-item-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.feature-item-hero:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon-hero {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--primary);
}

.feature-text-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-title-hero {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-desc-hero {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   LOGIN PANEL (RIGHT)
   ══════════════════════════════════════════════════════════ */

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
}

.login-content {
  width: 100%;
  max-width: 400px;
  animation: fade-in-up 0.6s ease both 0.1s;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Error Alert */
.error-alert {
  display: none;
  padding: 12px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  margin-bottom: 24px;
  animation: slide-down 0.3s ease both;
}

.error-alert.show {
  display: flex;
  gap: 12px;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.error-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--error);
  margin-bottom: 2px;
}

.error-message {
  font-size: 13px;
  color: #c5221f;
  line-height: 1.4;
}

/* Google Button */
.google-btn {
  position: relative;
  display: block;
  width: 100%;
  text-decoration: none;
  margin-bottom: 32px;
}

.google-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.google-btn:hover .google-btn-content {
  background: var(--bg-secondary);
  border-color: #adb1b5;
  box-shadow: var(--shadow-md);
}

.google-btn:active .google-btn-content {
  background: var(--bg-tertiary);
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-btn-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.google-btn-shine {
  display: none;
}

/* Security Info */
.security-info {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 8px;
  margin-bottom: 24px;
}

.security-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--info);
}

.security-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.security-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.security-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Info Note */
.info-note {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}

.info-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
}

.info-note p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Login Footer */
.login-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.login-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .hero-title {
    font-size: 44px;
  }
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  .hero-panel {
    padding: 60px 40px 40px;
    border-bottom: 1px solid var(--border);
  }
  
  .login-panel {
    border-left: none;
    padding: 40px 40px 60px;
  }
  
  .hero-title {
    font-size: 40px;
  }
}

@media (max-width: 768px) {
  .hero-panel,
  .login-panel {
    padding: 40px 24px;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .hero-description {
    font-size: 16px;
  }
  
  .login-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .logo-image {
    width: 40px;
    height: 40px;
  }
  
  .logo-title {
    font-size: 18px;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .login-title {
    font-size: 22px;
  }
  
  .feature-item-hero {
    padding: 16px;
  }
}

/* ══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════════════════ */

*:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

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

/* Print */
@media print {
  .background {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   EMAIL / PASSWORD AUTH — additional components
   ══════════════════════════════════════════════════════════ */

/* Auth view toggle */
.auth-view { display: none; }
.auth-view.active { display: block; }

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--bg-primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-tab:not(.active):hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Form fields */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label-hint {
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* Submit button */
.submit-btn {
  position: relative;
  width: 100%;
  padding: 11px 24px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-label {
  transition: opacity 0.15s;
}

/* Spinner inside button */
.btn-spinner {
  display: none;
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

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

/* Divider between submit and Google */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

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

.auth-divider span {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Success alert (mirrors error-alert) */
.success-alert {
  display: none;
  padding: 12px 16px;
  background: #e6f4ea;
  border: 1px solid #a8d5b5;
  border-radius: 8px;
  margin-bottom: 24px;
  animation: slide-down 0.3s ease both;
}

.success-alert.show {
  display: flex;
  gap: 12px;
}
