/* ===== Reset & Root ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0b;
  --bg-elevated: #131316;
  --bg-card: #17171a;
  --border: #232327;
  --border-light: #2e2e33;
  --text: #e8e6e0;
  --text-dim: #9a9890;
  --text-faint: #63625f;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent2: #38bdf8;
  --danger: #f87171;
  --radius: 10px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ambient blending background (go3.ch-style drifting blobs), in nas3's own
   teal + sky-blue pair — subtle enough to stay behind cards/tables */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.16;
  animation: nas3-drift 22s ease-in-out infinite alternate;
}

body::before {
  width: 560px; height: 560px;
  background: var(--accent);
  top: -180px; left: -160px;
}

body::after {
  width: 460px; height: 460px;
  background: var(--accent2);
  bottom: -140px; right: -140px;
  animation-duration: 18s;
  animation-direction: alternate-reverse;
}

@keyframes nas3-drift {
  0% { transform: translate(0,0) scale(1); }
  100% { transform: translate(36px, 26px) scale(1.06); }
}

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

img, svg { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-bottom: 1px solid rgba(45,212,191,0.25);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 40px rgba(0,0,0,0.4);
}

.site-header .container { width: 100%; }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); }
.logo span { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lang-switch {
  display: flex;
  gap: 4px;
  font-size: 0.85rem;
}

.lang-switch a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-dim);
}
.lang-switch a.active {
  color: var(--bg);
  background: var(--accent);
}
.lang-switch a:not(.active):hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #06201c;
}
.btn-primary:hover { background: var(--accent-hover); color: #06201c; }

.btn-ghost {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--danger);
  color: #2a0a0a;
}
.btn-danger:hover { background: #ef5350; }

.btn-block { width: 100%; text-align: center; }

/* ===== Hero ===== */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Plans ===== */
.section { padding: 64px 0; }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.plan-card-featured {
  border-color: var(--accent);
}

.plan-card-coming-soon {
  opacity: 0.5;
  filter: grayscale(60%);
}

.plan-card-coming-soon,
.plan-card-coming-soon * {
  cursor: default;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-badge-popular {
  background: var(--accent);
  color: #06201c;
}

.plan-badge-soon {
  top: 12px;
  right: 12px;
  left: auto;
  transform: none;
  background: var(--border-light);
  color: var(--text-dim);
}

.plan-name { font-size: 1.1rem; font-weight: 700; }
.plan-storage { display: flex; flex-direction: column; }
.plan-storage-value { color: var(--text); font-size: 2.375rem; font-weight: 800; line-height: 1.15; }
.plan-storage-label { color: var(--text-dim); font-size: 0.85rem; }
.plan-price { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.plan-price small { font-size: 0.9rem; color: var(--text-dim); font-weight: 500; }
.plan-backup { font-size: 0.85rem; color: var(--text-dim); margin-top: -0.25rem; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.btn-disabled {
  background: var(--border-light);
  color: var(--text-dim);
  cursor: default;
}

.plan-coming-soon-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 8px;
  text-align: center;
}

.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ===== Forms ===== */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.field-checkbox input { width: 16px; height: 16px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
}
.alert-success {
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--accent);
}
.alert-info {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-dim);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.auth-footer-form {
  margin-top: 12px;
}

.code-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.code-boxes input.code-box {
  width: 48px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

@media (max-width: 375px) {
  .code-box {
    width: 40px;
    height: 50px;
  }
}

/* ===== Dashboard app shell ===== */
.nas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.nas-account { position: relative; }
.nas-account summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.nas-account summary::-webkit-details-marker { display: none; }
.nas-account summary:hover { background: var(--bg-elevated); color: var(--text); }
.nas-account-name { font-weight: 600; }
.nas-gear { font-size: 1rem; }

.nas-account-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 180px;
  z-index: 20;
  flex-direction: column;
  gap: 10px;
}
.nas-account[open] .nas-account-menu { display: flex; }
.nas-account-plan {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nas-account-logout {
  color: var(--text);
  font-size: 0.9rem;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.nas-account-logout:hover { color: var(--accent); }

.nas-account-delete {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--danger);
  font-size: 0.85rem;
  opacity: 0.75;
}
.nas-account-delete:hover { opacity: 1; }

.nas-shell {
  flex: 1;
  display: flex;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  gap: 32px;
  padding: 24px;
  align-items: flex-start;
}

.nas-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.nas-nav { display: flex; flex-direction: column; gap: 2px; }
.nas-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
}
.nas-nav-item:hover { background: var(--bg-elevated); color: var(--text); }
.nas-nav-item.active { background: var(--accent-dim); color: var(--accent); }

.nas-sidebar-divider { height: 1px; background: var(--border); }

.nas-storage-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.nas-storage-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border-light);
  margin-bottom: 8px;
}
.nas-storage-text { font-size: 0.8rem; color: var(--text-faint); }

.nas-main { flex: 1; min-width: 0; }

.nas-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.nas-main-header h1 { font-size: 1.5rem; letter-spacing: -0.02em; }

.fm-new-menu { position: relative; }
.fm-new-menu summary {
  list-style: none;
  cursor: pointer;
}
.fm-new-menu summary::-webkit-details-marker { display: none; }
.fm-new-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 260px;
  z-index: 20;
  flex-direction: column;
  gap: 12px;
}
.fm-new-menu[open] .fm-new-menu-panel { display: flex; }

.fm-upload-form { gap: 10px; }

.fm-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fm-upload-zone:hover,
.fm-upload-zone.fm-drop-target {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.fm-upload-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.fm-upload-zone-icon {
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
}
.fm-upload-zone-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}
.fm-upload-submit {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.fm-upload-submit:hover { background: var(--accent-hover); }
.fm-upload-submit:disabled { opacity: 0.6; cursor: default; }

.fm-page-dropzone {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(10, 10, 11, 0.82);
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.fm-page-dropzone.active { display: flex; }
.fm-page-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 64px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 1rem;
}
.fm-page-dropzone-icon {
  font-size: 2.2rem;
  color: var(--accent);
}

.fm-breadcrumbs {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.fm-breadcrumbs a { color: var(--text-dim); padding: 2px 4px; border-radius: 4px; }
.fm-breadcrumbs a:hover { color: var(--accent); }
.fm-breadcrumbs a.fm-drop-target { background: var(--accent-dim); color: var(--accent); }
.fm-crumb-sep { margin: 0 6px; }

.fm-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.fm-inline-form input[type="text"] {
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
}
.fm-inline-form input[type="file"] {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 180px;
}

.fm-bulkbar {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--accent);
}
.fm-bulkbar.active { display: flex; }
.fm-bulk-form { display: flex; align-items: center; gap: 8px; }

.fm-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.fm-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.fm-table th, .fm-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.fm-table tbody tr:last-child td { border-bottom: none; }
.fm-table tbody tr[draggable="true"] { cursor: grab; }
.fm-table tbody tr.fm-dragging { opacity: 0.4; }
.fm-table tbody tr.fm-drop-target td { background: var(--accent-dim); }
.fm-table thead th {
  color: var(--text-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: var(--bg-elevated);
}
.fm-table thead th a { color: inherit; }
.fm-table thead th a:hover { color: var(--accent); }
.fm-col-check { width: 32px; }
.fm-col-size { width: 110px; color: var(--text-faint); }
.fm-col-date { width: 140px; color: var(--text-faint); font-size: 0.82rem; }
.fm-col-actions { width: 1%; white-space: nowrap; text-align: right; }

.fm-name {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}
a.fm-name:hover { color: var(--accent); }

.fm-row-action {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.fm-col-actions form.fm-row-action { margin-left: 8px; }
.btn-small {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.fm-star {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border-light);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.fm-star:hover { color: var(--text-dim); }
.fm-star.active { color: var(--accent); }

.fm-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (max-width: 720px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .hero { padding: 64px 0 48px; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .nav-right { width: 100%; justify-content: space-between; }

  .nas-shell { flex-direction: column; align-items: stretch; padding: 16px; gap: 16px; }
  .nas-sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .nas-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nas-sidebar-divider { display: none; }
  .nas-storage { flex: 1 1 160px; }
  .nas-upgrade { width: auto; flex-shrink: 0; }
  .fm-col-date { display: none; }
  .fm-table th, .fm-table td { padding: 9px 10px; }
}

/* --- Zero-knowledge crypto modals (assets/js/crypto.js) --- */

.nas3-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.nas3-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nas3-modal h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
}

.nas3-modal p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.nas3-modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}

.nas3-modal-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}

.nas3-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.nas3-recovery-key {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-align: center;
  word-break: break-all;
  margin-bottom: 4px;
}

.nas3-inline-error:empty {
  display: none;
}

/* --- Cookie consent banner (assets/js/main.js) --- */

.nas3-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.nas3-cookie-banner p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  flex: 1 1 260px;
}

.nas3-cookie-banner button {
  flex-shrink: 0;
}
