/* ============================================
   WEBINAR POPUP MANAGER — admin styles
   ============================================ */

:root {
  --navy: #4a5e72;
  --navy-dark: #2d3e4e;
  --navy-light: #6b8ba4;
  --gold: #d4a843;
  --gold-light: #e8cc7a;
  --gold-dark: #b8922e;
  --cream: #f5f7f9;
  --cream-dark: #e8ecf0;
  --text: #2d3e4e;
  --text-muted: #6b7d8d;
  --slate: #5a6a78;
  --border: #d8dfe6;
  --white: #ffffff;
  --error: #c54545;
  --success: #2d7d4f;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* The [hidden] attribute must always win over our display:flex etc. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
}

/* ─── LOGIN SCREEN ───────────────────────────────────────────── */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  background-attachment: fixed;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 44px 36px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.lock-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 8px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--navy); }

/* ─── ADMIN HEADER ───────────────────────────────────────────── */

.admin-header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 28px 0;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.admin-header h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.session-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}

/* ─── ADMIN MAIN ─────────────────────────────────────────────── */

.admin-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 100px;
}

.card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 28px 32px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

.card-help {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-help strong { color: var(--navy-dark); font-weight: 600; }

/* ─── TOGGLE ─────────────────────────────────────────────────── */

.toggle-card { padding: 24px 32px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.toggle-card h2 { margin-bottom: 4px; }
.toggle-card .card-help { margin-bottom: 0; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  user-select: none;
  cursor: pointer;
}

.switch input { display: none; }

.slider {
  position: relative;
  width: 56px;
  height: 30px;
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s;
}

.slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s;
}

.switch input:checked + .slider {
  background: var(--gold);
  border-color: var(--gold-dark);
}
.switch input:checked + .slider::before {
  transform: translateX(26px);
}

.switch-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  min-width: 32px;
}

.switch input:checked ~ .switch-label {
  color: var(--gold-dark);
}

/* ─── DROPZONE ───────────────────────────────────────────────── */

.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  min-height: 200px;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--gold);
  background: #fffaeb;
  outline: none;
}

.dropzone.is-dragging {
  border-color: var(--gold);
  background: #fff4d6;
  border-style: solid;
}

.dropzone.has-image { border-style: solid; padding: 0; }

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}

.dropzone-empty p { margin: 0; }
.dropzone-empty p strong { color: var(--navy); font-weight: 600; }
.dropzone-hint { font-size: 0.8rem; opacity: 0.75; }

.dropzone-preview {
  position: relative;
  height: 280px;
  background: var(--navy-dark);
}
.dropzone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  font-size: 0.85rem;
}

/* ─── FIELDS ─────────────────────────────────────────────────── */

.field {
  display: block;
  margin-bottom: 20px;
}

.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.req { color: var(--gold-dark); font-weight: 700; }

.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fbecec;
  border-left: 3px solid var(--error);
  color: var(--error);
  font-size: 0.85rem;
  border-radius: 4px;
}

/* ─── ACTION BAR ─────────────────────────────────────────────── */

.action-bar {
  position: sticky;
  bottom: 0;
  margin: 8px -32px -32px;
  padding: 18px 32px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-radius: 0 0 14px 14px;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.save-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: opacity 0.3s;
}
.save-status.is-success { color: var(--success); font-weight: 600; }
.save-status.is-error { color: var(--error); font-weight: 600; }

/* ─── BUTTONS ────────────────────────────────────────────────── */

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  border: 1px solid var(--gold-dark);
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-dark);
  color: var(--white);
}

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

.action-bar .btn-primary { width: auto; }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--cream); border-color: var(--navy-light); }

.btn-ghost-small {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-ghost-small:hover { background: rgba(255,255,255,0.25); }

.admin-header-right .btn-ghost {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}
.admin-header-right .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 600px) {
  .admin-header-inner { padding: 0 20px; flex-direction: column; align-items: flex-start; }
  .admin-main { padding: 20px; padding-bottom: 100px; }
  .card { padding: 22px 20px; }
  .login-card { padding: 36px 24px; }
  .toggle-row { flex-direction: column; align-items: flex-start; }
  .action-bar { margin: 8px -20px -22px; padding: 14px 20px; }
  .action-bar-right { margin-left: 0; width: 100%; justify-content: space-between; }
}
