/* ============================================================
   GNB-TECH — Enterprise Corporate Login Styles
   Clean, Minimal & Professional Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --success: #10b981;
  --danger: #ef4444;

  /* Default Dark Corporate Palette matching GNB-TECH background image */
  --bg-gradient: linear-gradient(135deg, #172647 0%, #121e38 50%, #0b1324 100%);
  --bg-pattern: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 15px);
  
  --surface: rgba(22, 36, 66, 0.75);
  --surface-solid: #172647;
  --surface-border: rgba(255, 255, 255, 0.12);
  
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --input-bg: rgba(15, 25, 48, 0.8);
  --input-border: rgba(255, 255, 255, 0.14);
  
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f0f4f9 0%, #e2e8f0 50%, #cbd5e1 100%);
  --bg-pattern: repeating-linear-gradient(-45deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.02) 1px, transparent 1px, transparent 15px);
  
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-border: rgba(203, 213, 225, 0.8);
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --input-bg: #f8fafc;
  --input-border: #cbd5e1;
  
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Corporate Pattern Overlay */
.bg-pattern-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-pattern);
  pointer-events: none;
  z-index: 0;
}

/* Diagonal GNB-TECH watermark */
[data-theme="dark"] .bg-pattern-overlay {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='160'%3E%3Cdefs%3E%3Cpattern id='p' patternUnits='userSpaceOnUse' width='320' height='160'%3E%3Ctext x='160' y='80' text-anchor='middle' dominant-baseline='central' transform='rotate(-30 160 80)' fill='white' opacity='0.045' font-family='Inter,sans-serif' font-size='22' font-weight='700' letter-spacing='5'%3EGNB-TECH%3C/text%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23p)'/%3E%3C/svg%3E"),
    var(--bg-pattern);
}

[data-theme="light"] .bg-pattern-overlay {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='160'%3E%3Cdefs%3E%3Cpattern id='p' patternUnits='userSpaceOnUse' width='320' height='160'%3E%3Ctext x='160' y='80' text-anchor='middle' dominant-baseline='central' transform='rotate(-30 160 80)' fill='%230f172a' opacity='0.08' font-family='Inter,sans-serif' font-size='22' font-weight='700' letter-spacing='5'%3EGNB-TECH%3C/text%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23p)'/%3E%3C/svg%3E"),
    var(--bg-pattern);
}

/* Theme Toggle Button */
.theme-toggle-login {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 10;
  transition: all var(--transition);
}

.theme-toggle-login:hover {
  transform: scale(1.08);
  border-color: var(--primary);
  color: var(--primary);
}

/* ---- LOGIN CENTER WRAPPER ---- */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ---- BRAND HEADER ---- */
.brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.logo-box {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.85rem;
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  padding: 8px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-tagline {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ---- LOGIN CARD ----
   White card by design in both themes; the page background around it
   follows the theme. */
.login-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
}

.card-title-wrap {
  margin-bottom: 1.5rem;
}

.card-title-wrap h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.card-title-wrap p {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* ERROR BANNER */
.login-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.login-error.show {
  display: flex;
}

/* FOOTER */
.login-footer {
  margin-top: 1.75rem;
  text-align: center;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* OAuth — primary login */
.oauth-buttons { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.btn-oauth { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .75rem 1.5rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; font-size: .9rem; font-weight: 600; color: #334155; cursor: pointer; transition: all .15s; }
.btn-oauth:hover { background: #f8fafc; border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.btn-google:hover { border-color: #4285F4; }
.btn-microsoft:hover { border-color: #00a4ef; background: #f0f9ff; }
.btn-oauth:disabled { opacity: .6; cursor: wait; }

/* ---- RESPONSIVE ---- */
@media (max-width: 576px) {
  body {
    padding: 1rem;
  }
  .login-wrapper {
    max-width: 100%;
  }
  .login-card {
    padding: 1.5rem 1.25rem;
  }
  .brand-name {
    font-size: 1.35rem;
  }
  .brand-tagline {
    font-size: 0.75rem;
  }
  .card-title-wrap h2 {
    font-size: 1.15rem;
  }
  .theme-toggle-login {
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}
