* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0b0d17;
  color: #e7e9f5;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 56px 20px;
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: -10%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
  filter: blur(60px);
  z-index: 0;
}

.bg-glow::after {
  content: '';
  position: fixed;
  bottom: -25%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.22), transparent 70%);
  filter: blur(60px);
}

.card {
  position: relative;
  z-index: 1;
  width: 420px;
  background: rgba(20, 22, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 40px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #a5b4fc, #c084fc 60%, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0 0 28px;
  padding-bottom: 24px;
  font-size: 13px;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
  margin-bottom: 6px;
  margin-top: 18px;
}

input[type='text'],
input[type='password'] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e7e9f5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type='text']:focus,
input[type='password']:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #b4b8d6;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.logout-link:hover {
  color: #c4b5fd;
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-1px);
}

.card-wide {
  width: 680px;
}

.muted {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  padding: 36px 0;
}

.page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.page-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  transition: border-color 0.15s, transform 0.15s;
}

.page-item:hover {
  border-color: rgba(129, 140, 248, 0.35);
  transform: translateY(-1px);
}

.page-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.25), rgba(192, 132, 252, 0.25));
  color: #c7d2fe;
}

.page-text {
  min-width: 0;
}

.page-folder {
  font-size: 14px;
  font-weight: 700;
  color: #f1f2fb;
}

.page-meta {
  font-size: 12px;
  color: #767b9e;
  margin-top: 2px;
  word-break: break-all;
}

.page-link {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #c4b5fd;
  text-decoration: none;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  padding: 7px 16px;
  background: rgba(168, 85, 247, 0.08);
  transition: background 0.15s, transform 0.15s;
}

.page-link:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: translateY(-1px);
}

.page-count {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: middle;
}

.file-drop {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 22px 14px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.07);
}

.file-drop input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

button {
  width: 100%;
  margin-top: 26px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.result {
  margin-top: 20px;
  padding: 14px;
  border-radius: 10px;
  font-size: 13px;
  word-break: break-all;
}

.hidden {
  display: none;
}

.result.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.result.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.result a {
  color: #93c5fd;
  text-decoration: underline;
}
