/* GDPR Portal — ISMS Card Design System
   Based on convert-policies-html.sh gradient header + orange accents */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a365d;
  --navy-light: #2b5278;
  --orange: #f6ad55;
  --orange-dark: #744210;
  --bg: #f0f4f8;
  --white: #ffffff;
  --gray-50: #f7fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-500: #a0aec0;
  --gray-600: #718096;
  --gray-700: #4a5568;
  --gray-900: #1a202c;
  --blue: #4299e1;
  --blue-dark: #2b6cb0;
  --red: #e53e3e;
  --green: #38a169;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.07);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
}
.nav-logo { height: 32px; width: auto; }
.nav-title { font-size: 1.1em; font-weight: 700; }
.nav-links {
  display: flex;
  gap: 16px;
  margin-left: auto;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9em;
}
.nav-links a:hover { color: white; }
.nav-user {
  margin-left: 20px;
  font-size: 0.88em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  font-size: 0.88em;
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px;
  flex: 1;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 28px;
}
.hero h1 {
  font-size: 2em;
  color: var(--navy);
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: 1.1em;
  color: var(--gray-600);
  margin-bottom: 32px;
}
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* Cards */
.card, .wizard-card, .auth-card, .action-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { color: var(--navy); margin-bottom: 8px; }
.card p { font-size: 0.93em; color: var(--gray-700); }

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.action-card {
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--orange);
  transition: transform 0.1s;
}
.action-card:hover { transform: translateY(-2px); }
.action-card h3 { color: var(--navy); margin-bottom: 6px; }
.action-card p { font-size: 0.9em; color: var(--gray-600); }

/* Auth */
.auth-container {
  display: flex;
  justify-content: center;
  padding-top: 60px;
}
.auth-card {
  width: 400px;
}
.auth-card h2 {
  color: var(--navy);
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.93em;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-full { width: 100%; text-align: center; }
.btn-small {
  padding: 5px 12px;
  font-size: 0.82em;
}
.btn-generate {
  background: var(--green);
  color: white;
}
.btn-generate:hover { background: #2f855a; }

/* Forms */
.form-group {
  margin-bottom: 16px;
  flex: 1;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88em;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.93em;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66,153,225,0.15);
}
.form-row {
  display: flex;
  gap: 16px;
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.checkbox-group label {
  font-weight: 400;
  font-size: 0.88em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.help-text {
  font-size: 0.88em;
  color: var(--gray-600);
  margin-bottom: 20px;
}

/* Alerts */
.alert {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9em;
}
.alert-error {
  background: #fed7d7;
  color: #9b2c2c;
  border-left: 4px solid var(--red);
}

/* Wizard */
.wizard { max-width: 800px; margin: 0 auto; }
.wizard-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}
.wizard-progress .step {
  flex: 1;
  padding: 10px 14px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 0.82em;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
}
.wizard-progress .step.active {
  background: var(--navy);
  color: white;
}
.wizard-progress .step.done {
  background: var(--green);
  color: white;
}
.wizard-card {
  border-left: 4px solid var(--orange);
}
.wizard-card h2 {
  color: var(--navy);
  margin-bottom: 8px;
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
  margin-bottom: 20px;
}
.data-table thead { background: var(--gray-50); }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 2px solid var(--gray-200);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table a { color: var(--blue-dark); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  margin-bottom: 20px;
}
.review-table th {
  background: var(--navy);
  color: white;
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
}
.review-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.review-table td:first-child {
  font-weight: 600;
  color: var(--gray-700);
  width: 180px;
}

/* Activity rows in ROPA */
.activity-row {
  margin-bottom: 16px;
  border-left: 4px solid var(--blue);
}
.activity-row h3 {
  color: var(--navy);
  font-size: 1em;
  margin-bottom: 12px;
}

/* Document view */
.doc-header { margin-bottom: 24px; }
.doc-header h1 { color: var(--navy); }
.doc-meta {
  display: flex;
  gap: 16px;
  font-size: 0.88em;
  color: var(--gray-600);
  margin: 8px 0;
}
.doc-actions { margin-top: 12px; display: flex; gap: 8px; }
.doc-preview {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.empty-state {
  text-align: center;
  color: var(--gray-500);
  padding: 40px;
}
.invite-form { margin-bottom: 24px; }

/* Footer */
.footer {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.78em;
  padding: 20px 28px;
  border-top: 1px solid var(--gray-100);
}

/* Input toggle (paste/upload tabs) */
.input-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}
.toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn.active {
  background: var(--navy);
  color: white;
}
.toggle-btn:hover:not(.active) {
  background: var(--gray-100);
}

/* File input */
.file-input {
  padding: 12px;
  border: 2px dashed var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
  cursor: pointer;
}
.file-input:hover {
  border-color: var(--blue);
  background: white;
}

/* Confidence indicator */
.confidence-indicator {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.88em;
  margin-bottom: 16px;
}
.confidence-high {
  background: #c6f6d5;
  color: #22543d;
  border-left: 4px solid var(--green);
}
.confidence-medium {
  background: #fefcbf;
  color: #744210;
  border-left: 4px solid var(--orange);
}
.confidence-low, .confidence-user_reviewed {
  background: #edf2f7;
  color: var(--gray-700);
  border-left: 4px solid var(--gray-500);
}

/* Gap analysis content */
.gap-analysis-content {
  background: var(--gray-50);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 0.9em;
  overflow-x: auto;
}

/* Supplementary context (collapsible) */
.supplementary-context {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.supplementary-context summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95em;
}
.supplementary-context summary:hover {
  color: var(--navy-light);
}
.supplementary-context h3 {
  color: var(--navy);
  font-size: 0.95em;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Context summary box (step 2) */
.context-summary {
  background: #ebf8ff;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.88em;
}
.context-summary ul {
  margin: 6px 0 0 18px;
  padding: 0;
}
.context-summary li {
  margin-bottom: 2px;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 16px; }
  .nav { padding: 12px 16px; flex-wrap: wrap; }
  .nav-links { gap: 10px; }
  .form-row { flex-direction: column; gap: 0; }
  .wizard-progress { flex-direction: column; }
  .hero-cards { grid-template-columns: 1fr; }
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media print {
  .nav, .footer, .wizard-progress, .wizard-actions, .action-bar, .btn { display: none; }
  body { background: white; }
  .container { max-width: none; padding: 0; }
}
