/* ========================================
   WRITE PAGE – WARM NEUTRAL DESIGN
   Matching blogs/read/admin pages
   ======================================== */

:root {
  --bg: #0b0b0b;
  --bg2: #0d0d0d;
  --surface: #0d0d0d;
  --surface-2: #111;
  --text: #f5f5f5;
  --muted: #ccc;
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.12);
  --accent: #ccc;
  --maxw: 1400px;
  --gutter: 28px;
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html.write-page {
  scroll-behavior: smooth;
}

body.write-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* ========================================
   HEADER (Minimal - matching other pages)
   ======================================== */
.write-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  pointer-events: none;
}

.write-header > * {
  pointer-events: auto;
}

.write-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  text-decoration: none;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
}

.write-brand:hover {
  opacity: 0.8;
}

.write-brand .b-tim {
  color: #fff;
}

.write-brand .b-x {
  color: rgba(255, 255, 255, 0.6);
  margin-left: 0;
}

.write-nav-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.write-nav-links {
  display: flex;
  gap: 8px;
}

.write-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.write-nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.write-nav-links button,
.write-nav-links .nav-logout {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
}

.write-nav-links button:hover,
.write-nav-links .nav-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* ========================================
   HERO SECTION (Warm/Neutral)
   ======================================== */
.write-hero {
  position: relative;
  min-height: clamp(300px, 38vh, 400px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0a0a0a;
  padding-top: 80px;
}

/* Noise texture overlay */
.write-hero .hero-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Gradient overlay - warm neutral */
.write-hero .hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(60, 60, 60, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(40, 40, 40, 0.1), transparent 50%);
  pointer-events: none;
}

/* Watermark text */
.write-hero .hero-watermark {
  position: absolute;
  top: 50%;
  right: 0%;
  left: auto;
  transform: translateY(-50%);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(140px, 20vw, 320px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.03);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  line-height: 0.8;
  opacity: 0;
  animation: fadeIn 1.5s ease forwards 0.5s;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Arc decoration */
.write-hero .hero-arc {
  position: absolute;
  top: 50%;
  right: -60px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 1.5s ease forwards 0.8s;
}

.write-hero .hero-arc::before {
  content: '';
  position: absolute;
  inset: 35px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

/* Particles - subtle */
.write-hero .hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.write-hero .particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: particleFloat 25s ease-in-out infinite;
}

.write-hero .particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.write-hero .particle:nth-child(2) { left: 25%; top: 60%; animation-delay: -4s; }
.write-hero .particle:nth-child(3) { left: 45%; top: 30%; animation-delay: -8s; }
.write-hero .particle:nth-child(4) { left: 60%; top: 70%; animation-delay: -12s; width: 3px; height: 3px; }
.write-hero .particle:nth-child(5) { left: 75%; top: 25%; animation-delay: -16s; }
.write-hero .particle:nth-child(6) { left: 85%; top: 55%; animation-delay: -20s; }

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.1; }
  50% { transform: translate(10px, -15px); opacity: 0.2; }
}

/* Hero Content */
.write-hero .hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 6vh, 80px) clamp(24px, 4vw, 60px);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(16px, 3vh, 24px);
}

/* Eyebrow */
.write-hero .hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: slideIn 0.6s ease forwards 0.2s;
}

.write-hero .eyebrow-line {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, #666, transparent);
}

.write-hero .eyebrow-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #aaa;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Title */
.write-hero .hero-title {
  font-family: "Bebas Neue", Inter, system-ui;
  font-size: clamp(48px, 9vw, 90px);
  line-height: 0.9;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 16px;
}

.write-hero .hero-word {
  display: inline-block;
  color: #fff;
  opacity: 0;
  transform: translateY(40px);
  animation: wordUp 0.8s ease forwards;
}

.write-hero .hero-word:nth-child(2) { animation-delay: 0.15s; }
.write-hero .hero-word:nth-child(3) { animation-delay: 0.25s; }

.write-hero .hero-word--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px #fff;
}

@keyframes wordUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Description */
.write-hero .hero-description {
  max-width: 460px;
  font-size: clamp(14px, 1rem, 16px);
  line-height: 1.6;
  color: #bbb;
  margin: 0;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.write-main-container {
  background: var(--bg);
  padding: clamp(32px, 5vh, 60px) clamp(20px, 4vw, 60px);
}

.write-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}

/* ========================================
   SIDEBAR
   ======================================== */
.write-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.sidebar-card:hover {
  border-color: var(--line-strong);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #ccc;
}

.card-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.card-body {
  padding: 16px 20px;
}

/* Form Fields */
.form-field {
  margin-bottom: 14px;
}

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

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form-field input:hover,
.form-field select:hover {
  border-color: var(--line-strong);
}

.form-field input:focus,
.form-field select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #888;
}

/* Textarea */
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form-field textarea:hover {
  border-color: var(--line-strong);
}

.form-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

/* Disabled inputs */
.form-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #aaa;
  pointer-events: none;
}

.select-wrapper select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}

.field-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.field-hint strong {
  color: #ccc;
}

/* Field Group (for main editor area) */
.field-group {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Editor Container Form Fields */
.editor-container .form-field {
  margin-bottom: 24px;
}

.editor-container .form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-container .form-field textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.editor-container .form-field textarea:hover {
  border-color: var(--line-strong);
}

.editor-container .form-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.editor-container .form-field textarea::placeholder {
  color: #666;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-item {
  text-align: center;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tips List */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tip-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #999;
  flex-shrink: 0;
}

.tip-text {
  font-size: 12px;
  color: #bbb;
  line-height: 1.4;
}

.tip-text kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
}

/* ========================================
   EDITOR SECTION
   ======================================== */
.write-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
}

.editor-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.editor-header h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 700;
  color: #fff;
}

.editor-subtitle {
  margin: 0;
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}

/* Editor Fields */
.editor-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-row {
  display: flex;
  gap: 18px;
}

.field-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-row .form-field.full {
  flex: 1;
}

.editor-fields .form-field label {
  font-size: 11px;
  margin-bottom: 8px;
}

.editor-fields .form-field input {
  padding: 14px 16px;
  font-size: 14px;
}

.editor-fields .form-field input.input-large {
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 600;
}

.required {
  color: #c88;
}

/* Editor Content Area */
.editor-content-area {
  min-height: 400px;
  padding: 24px;
  padding-right: 90px;
  position: relative;
  overflow: visible;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s ease;
}

/* Selection color */
.editor-content-area ::selection {
  background: rgba(100, 140, 180, 0.35);
}

.editor-content-area ::-moz-selection {
  background: rgba(100, 140, 180, 0.35);
}

.editor-content-area:hover {
  border-color: var(--line-strong);
}

.editor-content-area:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Editor Actions */
.editor-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0a0a0a;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit:hover:not(:disabled) {
  background: #e5e5e5;
}

.btn-submit svg {
  transition: transform 0.3s ease;
}

.btn-submit:hover:not(:disabled) svg {
  transform: translateX(3px);
}

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

.msg-status {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
  .write-grid {
    grid-template-columns: 260px 1fr;
    gap: 24px;
  }
}

@media (max-width: 900px) {
  .write-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .write-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .sidebar-card.tips-card {
    grid-column: span 2;
  }

  .write-hero .hero-title {
    font-size: clamp(40px, 8vw, 70px);
  }
}

@media (max-width: 768px) {
  .write-header {
    padding: 16px 20px;
  }

  .write-brand {
    font-size: 26px;
  }

  .write-nav-links a {
    padding: 8px 14px;
    font-size: 12px;
  }

  .write-hero .hero-content {
    text-align: center;
    align-items: center;
  }

  .write-hero .hero-eyebrow {
    justify-content: center;
  }

  .write-hero .hero-title {
    justify-content: center;
  }

  .write-hero .hero-description {
    text-align: center;
  }

  .write-hero .hero-word--outline {
    -webkit-text-stroke-width: 1px;
  }

  .write-hero .hero-watermark {
    font-size: clamp(80px, 25vw, 150px);
    right: -5%;
  }

  .write-hero .hero-arc {
    width: 200px;
    height: 200px;
    right: -60px;
  }
}

@media (max-width: 600px) {
  .write-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar-card.tips-card {
    grid-column: span 1;
  }

  .field-row.two-col {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-item {
    padding: 10px 6px;
  }

  .stat-value {
    font-size: 16px;
  }

  .write-editor {
    padding: 20px;
  }

  .editor-content-area {
    min-height: 280px;
    padding: 16px;
  }

  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .editor-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========================================
   ADMIN EDIT PAGE STYLES
   ======================================== */

/* Nav logout button */
.nav-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-logout:hover {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

/* Status Badge */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--draft {
  background: rgba(234, 179, 8, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge--published {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator {
  margin-bottom: 16px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-buttons .btn-submit {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
}

.action-buttons .btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #9333ea);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn--success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.action-btn--success:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.6);
}

.action-btn--danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
}

/* Status Message */
.status-msg {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  min-height: 20px;
  transition: all 0.2s ease;
}

.status-msg.success {
  color: #86efac;
}

.status-msg.error {
  color: #fca5a5;
}

/* Login Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-panel {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal-panel h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.modal-desc {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.modal-msg {
  font-size: 13px;
  color: var(--muted);
}

.modal-msg.error {
  color: #fca5a5;
}

.modal-panel .form-field input {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.modal-panel .form-field input:focus {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel .btn-submit {
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
}

.modal-panel .btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #9333ea);
}

/* Eyebrow Link */
.eyebrow-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.eyebrow-link:hover {
  color: var(--accent);
}

/* Form Row (side by side fields) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Field Hint Inline */
.field-hint-inline {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

/* Legacy Notice */
.legacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  color: #fcd34d;
}

.legacy-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.legacy-notice strong {
  display: block;
  margin-bottom: 4px;
}

.legacy-notice p {
  margin: 0;
  font-size: 13px;
  color: rgba(252, 211, 77, 0.8);
}

/* Markdown Preview */
.markdown-preview {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  min-height: 400px;
  font-size: 16px;
  line-height: 1.7;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  color: var(--text);
  margin: 24px 0 12px;
}

.markdown-preview h1:first-child,
.markdown-preview h2:first-child,
.markdown-preview h3:first-child {
  margin-top: 0;
}

.markdown-preview p {
  margin: 12px 0;
  color: var(--text-secondary);
}

.markdown-preview code {
  background: rgba(14, 165, 233, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.9em;
}

.markdown-preview pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-preview pre code {
  background: none;
  padding: 0;
  color: #e5e5e5;
}

.markdown-preview blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--muted);
  font-style: italic;
}

.markdown-preview ul,
.markdown-preview ol {
  padding-left: 24px;
  margin: 12px 0;
}

.markdown-preview li {
  margin: 6px 0;
  color: var(--text-secondary);
}

.markdown-preview a {
  color: var(--accent);
  text-decoration: none;
}

.markdown-preview a:hover {
  text-decoration: underline;
}

.markdown-preview img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
