@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

:root {
  --bg:       #0e0e0e;
  --surface:  #161616;
  --border:   #2a2a2a;
  --muted:    #444;
  --text:     #e8e8e8;
  --sub:      #888;
  --accent:   #e8ff47;
  --danger:   #ff4f4f;
  --success:  #47ffb2;
  --radius:   6px;
}

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

html { font-size: 15px; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ── */
.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.card-wide {
  max-width: 1000px;
}

/* ── Header ── */
.site-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--sub);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--text); border-color: var(--muted); }

/* ── Typography ── */
h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

h1 span {
  color: var(--accent);
}

label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--sub);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Inputs ── */
input[type="password"],
input[type="file"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  margin-bottom: 20px;
  transition: border-color 0.15s;
  outline: none;
}

input[type="password"]:focus,
input[type="file"]:focus {
  border-color: var(--accent);
}

input[type="file"] {
  cursor: pointer;
  padding: 8px 12px;
}

input[type="file"]::file-selector-button {
  background: var(--border);
  border: none;
  color: var(--text);
  padding: 5px 12px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 10px;
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0e0e0e;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #3a1a1a;
  padding: 5px 10px;
  font-size: 0.75rem;
}
.btn-danger:hover { background: #1e0a0a; border-color: var(--danger); }

/* ── Messages ── */
.msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border-left: 3px solid;
}
.msg-error  { background: #1a0a0a; color: var(--danger);  border-color: var(--danger); }
.msg-success{ background: #0a1a12; color: var(--success); border-color: var(--success); }

/* ── File info ── */
.file-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--sub);
  margin: -14px 0 20px;
  min-height: 18px;
  transition: color 0.15s;
}
.file-hint.over { color: var(--danger); }

/* ── Success page ── */
.preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  margin-bottom: 24px;
  text-align: center;
}
.preview-wrap img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 24px;
}
.url-row a {
  flex: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.url-row a:hover { text-decoration: underline; }

.btn-copy {
  background: var(--border);
  border: none;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-copy:hover { background: var(--muted); }

/* ── Gallery ── */
.gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-meta-bar {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--sub);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.gallery-item:hover { border-color: var(--muted); }

.gallery-item a { display: block; }
.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #111;
}

.gallery-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
}

.gallery-item-size {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--sub);
}

.item-actions {
  display: flex;
  gap: 5px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--sub);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon.danger:hover { background: #1e0a0a; color: var(--danger); border-color: #3a1a1a; }

/* ── Error pages ── */
.error-page {
  text-align: center;
}
.error-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 5rem;
  font-weight: 600;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}
.error-msg {
  color: var(--sub);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeUp 0.3s ease both; }
