:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3f56;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(34, 197, 94, 0.08), transparent);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(960px, 100% - 2rem);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.card + .card {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.label-hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

input[type="text"],
input[type="url"],
input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

input.is-invalid {
  border-color: var(--danger);
}

input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.field-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.field-error.is-visible {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  width: 100%;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-block {
  width: 100%;
  margin-top: 1.5rem;
}

/* Meeting page */
.meeting-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .meeting-layout {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.quota-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quota-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-value.quota-total {
  color: var(--primary);
}

.stat-value.quota-available {
  color: var(--success);
}

.stat-value.quota-full {
  color: var(--danger);
}

.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-fill.is-full {
  background: var(--danger);
}

.join-section {
  margin-top: 0.5rem;
}

.quota-message {
  text-align: center;
  padding: 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-weight: 600;
  font-size: 1rem;
}

.quota-message.is-hidden {
  display: none;
}

.join-btn-wrapper.is-hidden {
  display: none;
}

.meeting-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.meeting-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge.badge-full {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.demo-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.demo-links p {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.demo-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 0.5rem;
  font-size: 0.9rem;
}

.demo-links a:hover {
  text-decoration: underline;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.inline-notice {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.inline-notice-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.share-link {
  margin-top: 0.5rem;
  margin-bottom: 0;
  word-break: break-all;
}

.share-link a {
  color: var(--primary);
  text-decoration: none;
}

.share-link a:hover {
  text-decoration: underline;
}
