* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body.page-login {
  background-image: url('/assets/login-bg.jpg');
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.page-vault {
  background-image: url('/assets/stage-bg.jpg');
}

/* ---------- shared glass card ---------- */
.glass-card {
  background: rgba(35, 22, 14, 0.42);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---------- login page ---------- */
.login-card {
  width: 380px;
  padding: 44px 40px 40px;
  text-align: center;
}
.login-card h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 32px;
  color: #f6ecdd;
  letter-spacing: 0.3px;
}
.tagline {
  margin-top: 8px;
  font-size: 14px;
  color: #e3a463;
}
.field { margin-top: 34px; text-align: left; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #e9ddce;
  margin-bottom: 8px;
}
input[type="email"], input[type="text"], input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  color: #f5ead9;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
input::placeholder { color: rgba(245,234,217,0.45); }
input:focus { border-color: rgba(232,165,92,0.7); }
input[data-otp] {
  letter-spacing: 8px;
  font-size: 20px;
  text-align: center;
}
.hint {
  margin-top: 10px;
  font-size: 11.5px;
  color: rgba(233,221,206,0.55);
  text-align: left;
}
.btn-primary {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0c684, #e19a52);
  color: #2b1d12;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(224,154,82,0.28);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-link {
  margin-top: 14px;
  background: none;
  border: none;
  color: #e3a463;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
}
.error-text {
  margin-top: 10px;
  font-size: 12.5px;
  color: #ff9b8a;
  text-align: left;
  min-height: 16px;
}
.footnote {
  margin-top: 20px;
  font-size: 11px;
  color: rgba(233,221,206,0.4);
}
.hidden { display: none !important; }

/* ---------- vault page ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #f6ecdd;
}
.exit-btn {
  padding: 9px 20px;
  background: rgba(35,22,14,0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  color: #e9ddce;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.exit-btn:hover { border-color: rgba(232,165,92,0.6); }

.stage {
  display: flex;
  justify-content: center;
  padding: 40px 20px 60px;
}
.vault-card {
  width: 640px;
  padding: 36px 40px 40px;
}

.tabs {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 28px;
}
.tab {
  padding: 9px 26px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(233,221,206,0.65);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
}
.tab.active {
  background: linear-gradient(135deg, #f0c684, #e19a52);
  color: #2b1d12;
}

.search-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
}
.search-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f5ead9;
  font-size: 14.5px;
  padding: 10px 0;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0c684, #e19a52);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }

.helper { margin-top: 12px; font-size: 11.5px; color: rgba(233,221,206,0.5); padding-left: 6px; }
.result-count { margin: 16px 2px 4px; font-size: 12px; color: rgba(233,221,206,0.55); }

.results { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.result-card {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px; padding: 14px 16px;
}
.thumb {
  width: 52px; height: 52px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.rinfo { flex: 1; min-width: 0; }
.rname { font-size: 14.5px; font-weight: 500; color: #f5ead9; }
.rmeta { margin-top: 3px; font-size: 12px; color: rgba(233,221,206,0.55); }
.rmeta span { margin-right: 14px; }
.view-btn {
  padding: 7px 16px; background: none;
  border: 1px solid rgba(255,255,255,0.24); border-radius: 8px;
  color: #e9ddce; font-size: 12px; font-weight: 500; cursor: pointer; flex-shrink: 0;
}

/* store tab */
.dropzone {
  margin-top: 18px;
  border: 1.5px dashed rgba(233,221,206,0.35);
  border-radius: 14px;
  padding: 26px;
  text-align: center;
  color: rgba(233,221,206,0.6);
  font-size: 13px;
  cursor: pointer;
}
.dropzone.drag-over { border-color: rgba(232,165,92,0.7); color: #e3a463; }
.dropzone strong { color: #e3a463; font-weight: 500; }
.dropzone input[type="file"] { display: none; }
.preview-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: #e9ddce; }
.preview-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.store-fields { display: flex; gap: 14px; margin-top: 18px; }
.store-fields .fld { flex: 1; }
.store-fields label { display: block; font-size: 11.5px; color: rgba(233,221,206,0.6); margin-bottom: 6px; font-weight: 500; }

.upload-btn {
  width: 100%; margin-top: 18px; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #f0c684, #e19a52); color: #2b1d12;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.upload-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.status-msg { margin-top: 14px; font-size: 12.5px; padding: 10px 12px; border-radius: 8px; }
.status-msg.error { background: rgba(255,90,70,0.12); color: #ff9b8a; }
.status-msg.success { background: rgba(120,200,140,0.12); color: #9fe6b0; }

.toast {
  position: fixed; bottom: 40px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(35, 22, 14, 0.92);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f5ead9; padding: 14px 26px; border-radius: 12px;
  font-size: 13.5px; opacity: 0;
  transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* lightbox for viewing a document image */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  color: #fff; font-size: 28px; cursor: pointer; background: none; border: none;
}
