@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #fff;
  --surface: #fff;
  --surface-alt: #f7f7f7;
  --border: #ddd;
  --border-hover: #aaa;
  --text: #111;
  --text-2: #444;
  --text-3: #888;
  --accent: #111;
  --accent-hover: #333;
  --accent-soft: #f0f0f0;
  --blue: #0055ff;
  --blue-soft: #f0f5ff;
  --green: #1a7f37;
  --green-soft: #ecfdf3;
  --red: #cf222e;
  --red-soft: #fff0f0;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111;
    --surface: #191919;
    --surface-alt: #1e1e1e;
    --border: #2a2a2a;
    --border-hover: #555;
    --text: #eee;
    --text-2: #aaa;
    --text-3: #666;
    --accent: #eee;
    --accent-hover: #ccc;
    --accent-soft: #222;
    --blue: #4d8eff;
    --blue-soft: #1a2233;
    --green: #3fb950;
    --green-soft: #0d2117;
    --red: #f85149;
    --red-soft: #2a1516;
  }
}

:root[data-theme="dark"] {
  --bg: #111;
  --surface: #191919;
  --surface-alt: #1e1e1e;
  --border: #2a2a2a;
  --border-hover: #555;
  --text: #eee;
  --text-2: #aaa;
  --text-3: #666;
  --accent: #eee;
  --accent-hover: #ccc;
  --accent-soft: #222;
  --blue: #4d8eff;
  --blue-soft: #1a2233;
  --green: #3fb950;
  --green-soft: #0d2117;
  --red: #f85149;
  --red-soft: #2a1516;
}

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

body {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--text);
  color: var(--bg);
  border-radius: 5px;
}

.logo-icon svg {
  width: 14px;
  height: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
}

.btn-icon:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ── Hero ── */
.hero {
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.hero p {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 4px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.card-body textarea {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: transparent;
  color: var(--text);
  resize: vertical;
  outline: none;
}

.card-body textarea::placeholder {
  color: var(--text-3);
}

.card-body textarea:focus {
  border-bottom-color: var(--text);
}

.card-footer {
  padding: 12px 16px 16px;
}

/* ── Form Fields ── */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 560px) {
  .options { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.label-icon {
  display: flex;
  color: var(--text-3);
}

input[type="text"],
input[type="password"],
select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.1s;
}

input:focus, select:focus {
  border-color: var(--text);
}

input::placeholder { color: var(--text-3); }

.hint {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.compact { width: auto; padding: 0 16px; }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.1s, color 0.1s;
}

.btn-action:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-action.copied {
  border-color: var(--green);
  color: var(--green);
}

/* ── Share Bar ── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  font-size: 12px;
  flex-wrap: wrap;
}

.share-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--blue);
  flex-shrink: 0;
}

.share-url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.share-bar .btn-action {
  height: 26px;
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Paste View ── */
.paste-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  gap: 10px;
  flex-wrap: wrap;
}

.paste-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.slug {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
}

.meta-tags {
  display: flex;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-3);
}

.paste-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.paste-body { padding: 0; }

.paste-content {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
  background: transparent;
  border: none;
}

.paste-content code { font-family: inherit; }

/* ── How It Works ── */
.how-it-works {
  margin-top: 2rem;
}

.how-it-works h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 10px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
}

.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}

.step-text {
  display: flex;
  flex-direction: column;
}

.step-text strong {
  font-size: 13px;
  font-weight: 600;
}

.step-text span {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── Password & Error ── */
.center-card {
  text-align: center;
  padding: 3rem 2rem;
}

.lock-hero, .error-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-3);
}

.lock-hero svg, .error-hero svg { opacity: 0.4; }

.center-card h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 20px;
}

.password-form {
  max-width: 340px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  gap: 6px;
}

.input-group input { flex: 1; }
.input-group .btn-primary { width: auto; flex-shrink: 0; }

/* ── Toast ── */
.toast {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}

.toast.error {
  background: var(--red-soft);
  color: var(--red);
  margin-bottom: 12px;
}

.toast.error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.toast.inline {
  justify-content: center;
  margin-bottom: 12px;
}

/* ── Theme Toggle ── */
#theme-toggle { position: relative; }
#theme-toggle .icon-sun, #theme-toggle .icon-moon { display: flex; }

/* Light mode (default): show moon (to switch to dark), hide sun */
.icon-sun { display: none !important; }
.icon-moon { display: flex !important; }

/* Dark via media query (no explicit theme set) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: flex !important; }
  :root:not([data-theme="light"]) .icon-moon { display: none !important; }
}

/* Explicit dark */
:root[data-theme="dark"] .icon-sun { display: flex !important; }
:root[data-theme="dark"] .icon-moon { display: none !important; }

/* Explicit light */
:root[data-theme="light"] .icon-sun { display: none !important; }
:root[data-theme="light"] .icon-moon { display: flex !important; }

/* ── Footer ── */
footer {
  margin-top: auto;
  padding-top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
}

.dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--text-3);
}
