:root {
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-tertiary: #18181b;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --accent-purple: #8b5cf6;
  --accent-purple-hover: #7c3aed;
  --success-green: #10b981;
  --error-red: #ef4444;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --color-bg-tertiary: #18181b;
  --color-border-medium: rgba(255, 255, 255, 0.1);
  --color-text-primary: #fafafa;
  --radius-md: 10px;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 0.875rem;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9375rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
}

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

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-purple-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

.form-group {
  margin-bottom: 1.25rem;
}

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

input, select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

.form-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-error {
  display: none;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--error-red);
}

.alert {
  padding: 0.875rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.125rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.08);
  color: var(--success-green);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--error-red);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #111113;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal-body {
  padding: 1.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Selection */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ========================================
   Mobile Base Styles
   ======================================== */
@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  /* Prevent iOS zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
  }

  /* Touch-friendly button sizes */
  .btn {
    min-height: 44px;
    padding: 0.625rem 1.25rem;
  }

  .form-group {
    margin-bottom: 1.25rem;
  }

  input {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }
}

/* ========================================
   Cookie Consent Banner
   ======================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 1rem 1.5rem;
  background: rgba(17, 17, 19, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cookie-banner-text {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-banner-text a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cookie-banner-text a:hover {
  color: var(--accent-purple-hover);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.125rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: var(--accent-purple);
  color: white;
}

.cookie-btn-accept:hover {
  background: var(--accent-purple-hover);
}

.cookie-btn-reject {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .cookie-banner {
    padding: 1rem;
  }

  .cookie-banner-inner {
    flex-direction: column;
    gap: 0.875rem;
    text-align: center;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    min-height: 44px;
  }
}
