/*
  Minimalist Professional CSS – Clean & Consistent
  Unified panel widths, clear hierarchy, elegant simplicity
*/

:root {
  --bg: #0a0e1a;
  --surface: #141824;
  --surface-raised: #1a1f2e;
  
  --primary: #4f7cff;
  --primary-hover: #6b8fff;
  --success: #0ea672;
  --danger: #e74c3c;
  
  --text: #e8eaed;
  --text-secondary: #9ca3af;
  --border: rgba(255, 255, 255, 0.1);
  
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* Unified card system - all panels same width */
.card {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

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

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* Buttons */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background: #1f2433;
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn.danger:hover {
  background: #c0392b;
  border-color: #c0392b;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Flash messages */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 350px;
  width: auto;
  margin-bottom: 0;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  font-size: 0.85rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.alert.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.alert-success {
  background: rgba(14, 166, 114, 0.1);
  border-color: var(--success);
  color: #4ade80;
}

.alert-error {
  background: rgba(231, 76, 60, 0.1);
  border-color: var(--danger);
  color: #f87171;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Utilities */
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-raised); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #252a3a; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .app {
    padding: 16px 12px;
  }
  
  .card {
    padding: 24px 20px;
    max-width: 100%;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }
  
  .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
  
  .actions {
    flex-direction: column;
    width: 100%;
  }
  
  .actions .btn {
    width: 100%;
  }
}

/* iPhone specific optimizations */
@media (max-width: 430px) {
  body {
    font-size: 15px;
  }
  
  .card {
    padding: 20px 16px;
    border-radius: 12px;
  }
  
  h1 {
    font-size: 1.4rem;
  }
  
  input[type="text"],
  input[type="password"],
  input[type="number"],
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}
