:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.022);
  --surface-input: #0d0d10;
  --border: rgba(120, 114, 109, 0.28);
  --border-strong: rgba(120, 114, 109, 0.42);
  --border-accent: rgba(158, 21, 249, 0.48);
  --accent: #9e15f9;
  --accent-soft: rgba(158, 21, 249, 0.16);
  --accent-text: #e9d5ff;
  --text: #ffffff;
  --muted: #a8a29e;
  --subtle: #d6d3d1;
  --ok: #22c55e;
  --err: #ef4444;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(680px circle at 50% 18%, rgba(158, 21, 249, 0.14), transparent 65%),
    radial-gradient(460px circle at 18% 82%, rgba(158, 21, 249, 0.07), transparent 60%);
  background-attachment: fixed;
  padding: 24px 14px;
  scrollbar-color: rgba(120, 114, 109, 0.45) var(--bg);
  scrollbar-width: thin;
}

body {
  width: 100%;
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 22px 24px 26px !important;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--surface) !important;
  box-shadow: 0 0 42px rgba(158, 21, 249, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body > br:first-child {
  display: none;
}

#pasta-form ~ br {
  display: none;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a:hover {
  color: var(--text);
}

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}

p {
  color: var(--subtle);
  margin: 0 0 10px 0;
}

hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 14px 0;
}

/* Top bar */
#nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px !important;
  border-bottom: 1px dashed var(--border);
}

#nav b {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-right: auto !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#nav b::after {
  content: "PRIVATE";
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px dashed rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

#nav a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--subtle);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  margin: 0 !important;
}

#nav a:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  background: rgba(158, 21, 249, 0.1);
}

/* Form layout */
#pasta-form > br:first-child {
  display: none;
}

#settings {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
  grid-template-rows: auto !important;
  gap: 10px !important;
  margin-bottom: 16px !important;
}

#settings > div {
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#settings > div br {
  display: none;
}

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

label sup a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  font-size: 9px;
  color: var(--muted);
}

label sup a:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

select,
input[type="text"],
input[type="password"] {
  width: 100% !important;
  height: 36px !important;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-input);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(158, 21, 249, 0.2);
}

select option,
select optgroup {
  background: #111115;
  color: var(--text);
}

#content-input,
textarea {
  width: 100% !important;
  min-height: 260px !important;
  margin: 6px 0 14px !important;
  padding: 14px;
  background: var(--surface-input);
  color: #e7e5e4;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#content-input::placeholder,
textarea::placeholder,
input::placeholder {
  color: #78716c;
}

/* Action footer */
#pasta-form > div:last-of-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#file-select {
  float: none !important;
}

#file-select br {
  display: none;
}

#attach-file-button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0 !important;
  height: 38px;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px dashed var(--border-strong) !important;
  background: var(--surface-2);
  color: var(--subtle);
  font-size: 13px !important;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

#attach-file-button-label:hover {
  border-color: var(--accent) !important;
  background: rgba(158, 21, 249, 0.1);
  color: var(--accent-text);
}

#attach-file-button {
  color: inherit;
}

#pasta-form b {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

#uploader_password {
  float: none !important;
  width: 195px !important;
  height: 38px !important;
}

#uploader_password[placeholder*="Incorrect"] {
  border-color: rgba(239, 68, 68, 0.75) !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

#submit-button,
button,
input[type="submit"],
.small-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

button:hover,
.small-button:hover,
.download-button:hover {
  border-color: var(--accent);
  background: rgba(158, 21, 249, 0.14);
  color: var(--accent-text);
}

#submit-button,
input[type="submit"] {
  float: none !important;
  width: auto !important;
  min-width: 128px;
  height: 38px;
  padding: 0 22px;
  border: 1px dashed rgba(158, 21, 249, 0.65) !important;
  background: rgba(158, 21, 249, 0.22) !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(158, 21, 249, 0.18);
}

#submit-button:hover,
input[type="submit"]:hover {
  background: rgba(158, 21, 249, 0.34) !important;
  border-color: rgba(158, 21, 249, 0.88) !important;
  box-shadow: 0 0 24px rgba(158, 21, 249, 0.28);
}

#submit-button:active,
button:active,
.small-button:active {
  transform: scale(0.98);
}

/* Paste viewer */
.small-button {
  height: 30px;
  padding: 0 11px !important;
  font-size: 12px !important;
  border-radius: 6px;
}

.code-container pre {
  margin: 12px 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface-input);
  color: #e7e5e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  overflow-x: auto;
}

.code-container code {
  font-family: inherit;
}

#decryption {
  background: var(--surface-2) !important;
  border: 1px dashed var(--border);
  border-radius: 8px !important;
  padding: 14px !important;
  width: 100% !important;
  max-width: 420px;
}

/* QR page */
div[style*="text-align: center"] svg {
  background: #ffffff;
  padding: 14px;
  border-radius: 10px;
  max-width: 260px;
  height: auto;
}

/* Tables & generic blocks (guide / admin) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

th, td {
  padding: 8px 10px;
  border: 1px dashed var(--border);
  text-align: left;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  html {
    padding: 12px 10px;
  }

  body {
    padding: 16px 15px 20px !important;
  }

  #settings {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #pasta-form > div:last-of-type {
    flex-direction: column;
    align-items: stretch;
  }

  #file-select,
  #attach-file-button-label {
    width: 100%;
  }

  #pasta-form b {
    width: 100%;
    margin-left: 0;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #uploader_password,
  #submit-button {
    width: 100% !important;
  }
}
