/* Faana Data Room - Shared Design System */

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

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

:root {
  /* Beige / Light Mode */
  --bg-primary: #EDE6DD;
  --bg-secondary: #E3DAD0;
  --bg-card: #F5F0EA;
  --bg-card-hover: #FAF7F3;

  /* Dark Mode */
  --bg-dark: #1E1E1E;
  --bg-dark-card: #2A2A2A;
  --bg-dark-subtle: #333333;

  /* Accent */
  --cyan: #00E5FF;
  --teal: #00D4AA;
  --cyan-dim: rgba(0, 229, 255, 0.15);
  --teal-dim: rgba(0, 212, 170, 0.12);
  --gradient-accent: linear-gradient(135deg, #00E5FF, #00D4AA);

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #8A8A7A;
  --text-light: #B0A89C;
  --text-on-dark: #F0ECE6;
  --text-on-dark-muted: #9A9A8A;

  /* Borders */
  --border-light: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.08);

  /* Status */
  --green: #4CAF50;
  --amber: #FFA726;
  --red: #EF5350;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top Navigation ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-logo {
  height: 28px;
  width: auto;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
}

.nav-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-email {
  font-size: 13px;
  color: var(--text-on-dark-muted);
  font-weight: 400;
}

.nav-signout {
  font-size: 12px;
  font-weight: 500;
  color: var(--cyan);
  background: none;
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.nav-signout:hover {
  background: var(--cyan-dim);
  border-color: rgba(0, 229, 255, 0.5);
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  max-width: 680px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-xl);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Document Grid ── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: 0 var(--space-xl);
  max-width: 1100px;
  margin: 0 auto var(--space-3xl);
}

@media (max-width: 900px) {
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .doc-grid { grid-template-columns: 1fr; }
}

/* ── Document Card ── */
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.doc-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.doc-card:hover::before {
  opacity: 1;
}

.doc-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--cyan-dim);
  color: var(--teal);
  margin-bottom: var(--space-md);
  width: fit-content;
}

.doc-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

.doc-card-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-md);
}

.doc-card-meta {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
}

.doc-card-arrow {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--space-lg);
  font-size: 16px;
  color: var(--text-light);
  transition: all 0.2s ease;
}

.doc-card:hover .doc-card-arrow {
  color: var(--teal);
  transform: translateX(3px);
}

/* ── Footer ── */
.portal-footer {
  background: var(--bg-dark);
  padding: var(--space-xl) var(--space-xl);
  text-align: center;
}

.footer-tagline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-sm);
}

.footer-brand {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.footer-brand a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

/* ── Login Page ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  padding: var(--space-xl);
}

.login-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  height: 36px;
  margin-bottom: var(--space-sm);
}

.login-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-2xl);
}

.login-field {
  width: 100%;
  margin-bottom: var(--space-md);
}

.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-xs);
  text-align: left;
  letter-spacing: 0.04em;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-dark-subtle);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-field input:focus {
  border-color: var(--cyan);
}

.login-field input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--gradient-accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-dark);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
  margin-top: var(--space-sm);
  letter-spacing: 0.02em;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-error {
  font-size: 13px;
  color: var(--red);
  margin-top: var(--space-md);
  min-height: 20px;
}

/* ── Auth Loading State ── */
.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.auth-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Page Wrapper (for sub-pages) ── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
}

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-lg) var(--space-xl);
  transition: color 0.2s ease;
}

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

/* ── Accent Line ── */
.accent-line {
  width: 40px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
}

/* ── Print ── */
@media print {
  .nav, .portal-footer, .back-link, .nav-signout { display: none; }
  body { background: white; }
  .doc-card { break-inside: avoid; }
}
