/* ========================================
   ZeDisparo User Portal - Dark Theme
   ======================================== */

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #00c896;
  --accent-hover: #00b085;
  --error: #ff4757;
  --warning: #ffa502;
  --border: #333;
  --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ========================================
   Pages (SPA)
   ======================================== */

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ========================================
   Container & Card
   ======================================== */

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px var(--shadow);
  margin-top: 3rem;
}

/* ========================================
   Typography
   ======================================== */

.brand-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.accent {
  color: var(--accent);
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.info-text {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.page-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.section-text {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ========================================
   Header
   ======================================== */

.header {
  background: var(--bg-secondary);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.header-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-user {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========================================
   Main Content
   ======================================== */

.main {
  padding: 2rem 0;
}

.section {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* ========================================
   Info Cards
   ======================================== */

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.info-card {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border);
}

.info-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.info-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

/* ========================================
   Instructions
   ======================================== */

.instructions {
  margin-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 2;
}

.instructions li {
  margin-bottom: 0.5rem;
}

.instructions code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

/* ========================================
   Forms
   ======================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: #555;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #2a2a2a;
}

.btn-logout {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-logout:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ========================================
   Error Message
   ======================================== */

.error-message {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}

.error-message.visible {
  display: block;
}

/* ========================================
   Link
   ======================================== */

.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
  display: block;
  margin-top: 1rem;
}

.link:hover {
  text-decoration: underline;
}

/* ========================================
   Modal
   ======================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 40px var(--shadow);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ========================================
   Loading Spinner
   ======================================== */

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
    margin-top: 1rem;
  }

  .info-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .header {
    padding: 1rem;
  }

  .header-brand {
    font-size: 1.25rem;
  }
}
