/* ============================================================
   sendform.online — Design System
   Dark theme · Glassmorphism · Inter font
   ============================================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-input: rgba(255, 255, 255, 0.15);

  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #64748b;
  --text-heading: #f1f5f9;

  --accent: #667eea;
  --accent-hover: #7c93ff;
  --accent-glow: rgba(102, 126, 234, 0.25);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --success: #48bb78;
  --danger: #fc8181;
  --danger-hover: #feb2b2;
  --warning: #f6ad55;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-slow);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand span { color: var(--accent); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.navbar-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.navbar-links a:hover { color: var(--text-heading); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

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

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 40px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-heading);
}

.btn-danger {
  background: rgba(252, 129, 129, 0.1);
  color: var(--danger);
  border: 1px solid rgba(252, 129, 129, 0.2);
}

.btn-danger:hover {
  background: rgba(252, 129, 129, 0.2);
  color: var(--danger-hover);
}

.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

/* ---------- Form Inputs ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Alert / Toast ---------- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.alert.show { display: block; animation: fadeSlideIn 0.3s ease; }

.alert-error {
  background: rgba(252, 129, 129, 0.1);
  color: var(--danger);
  border: 1px solid rgba(252, 129, 129, 0.2);
}

.alert-success {
  background: rgba(72, 187, 120, 0.1);
  color: var(--success);
  border: 1px solid rgba(72, 187, 120, 0.2);
}

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

.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 { margin: 0; }

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

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

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent-hover);
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p { font-size: 0.95rem; }

/* ---------- Copy Button ---------- */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--success); }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ---------- Auth Layout ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1040 50%, var(--bg-primary) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card .logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card .logo h2 {
  font-size: 1.5rem;
}

.auth-card .footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Dashboard Layout ---------- */
.dashboard-page {
  padding-top: 5rem;
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-card {
  margin-bottom: 1rem;
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.form-endpoint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  overflow: hidden;
}

.form-endpoint code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.submissions-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Landing — Hero ---------- */
.hero {
  padding: 8rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.hero h1 {
  margin-bottom: 1.25rem;
  position: relative;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Landing — Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  text-align: center;
}

.feature-card:hover { transform: translateY(-4px); }

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Landing — How It Works ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.step h3 { margin-bottom: 0.5rem; }

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

/* ---------- Landing — Code Snippet ---------- */
.code-section { text-align: center; }

.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  text-align: left;
  max-width: 600px;
  margin: 2rem auto 0;
  overflow-x: auto;
}

.code-block pre {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block .tag { color: #fc8181; }
.code-block .attr { color: #f6ad55; }
.code-block .val { color: #68d391; }
.code-block .comment { color: var(--text-muted); font-style: italic; }

/* ---------- Landing — Footer ---------- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-glass);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar-links { gap: 1rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 6rem 0 3rem; }
  .glass-card { padding: 1.5rem; }
  .modal { padding: 1.5rem; }
  .form-endpoint { font-size: 0.7rem; }
  .dashboard-header { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .navbar-links .btn { display: none; }
  .hero-buttons { flex-direction: column; align-items: center; }
}
