:root {
  --primary: #0b5fa5;
  --primary-dark: #073e6e;
  --accent: #4fb6e8;
  --glacier: #eaf6fb;
  --frost: #f6fbfd;
  --white: #ffffff;
  --text: #12283b;
  --muted: #5b7a90;
  --border: #cfe8f3;
  --success: #2e9e6c;
  --danger: #d64545;
  --warning: #b9790a;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(11, 95, 165, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--frost);
  color: var(--text);
  line-height: 1.5;
}

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

h1, h2, h3, h4 {
  color: var(--primary-dark);
  margin: 0 0 0.5em 0;
}

button, input, select {
  font-family: inherit;
  font-size: 1rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-dark);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.topnav a {
  color: var(--muted);
  font-weight: 600;
}
.topnav a:hover {
  color: var(--primary);
  text-decoration: none;
}
.topnav .btn-primary,
.topnav .btn-primary:hover {
  color: white;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}
.btn-secondary {
  background: var(--glacier);
  color: var(--primary-dark);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #dcf0f9;
  text-decoration: none;
}
.btn-danger {
  background: var(--white);
  color: var(--danger);
  border-color: #f3caca;
}
.btn-danger:hover {
  background: #fdecec;
  text-decoration: none;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}

/* ---------- Landing page ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 5rem 1.25rem 6rem;
  text-align: center;
}
.hero h1 {
  color: white;
  font-size: 2.6rem;
  margin-bottom: 0.6rem;
}
.hero p {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 2rem;
  color: #eaf6fb;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .btn-secondary {
  background: white;
  color: var(--primary-dark);
  border-color: transparent;
}
.hero .btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.7);
}
.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.features {
  max-width: 1100px;
  margin: -3rem auto 4rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border);
}
.feature-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--glacier);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}
.feature-card p {
  color: var(--muted);
  margin: 0;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glacier);
  padding: 2rem 1.25rem;
}
.auth-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}
.auth-card h1 {
  font-size: 1.5rem;
  text-align: center;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.field {
  margin-bottom: 1.1rem;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--primary-dark);
}
.field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--frost);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 182, 232, 0.25);
}
.field .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.checkbox-field label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.legal-page h1 {
  font-size: 1.75rem;
}
.legal-page .updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.legal-page h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
}
.legal-page p, .legal-page li {
  color: var(--text);
  font-size: 0.95rem;
}
.legal-page ul {
  padding-left: 1.25rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.captcha-widget {
  position: relative;
  border: 1.5px solid #a9d8ec;
  border-radius: 8px;
  background: var(--frost);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.1rem;
}
.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}
.captcha-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: white;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.captcha-checkbox:checked {
  border-color: var(--primary);
  background: var(--primary);
}
.captcha-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.captcha-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 182, 232, 0.35);
}
.captcha-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.captcha-copy {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 600;
}
.captcha-status {
  min-height: 1.1em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
.captcha-widget.is-verified .captcha-status {
  color: var(--success);
  font-weight: 600;
}
.captcha-widget.is-error .captcha-status {
  color: var(--danger);
}
.captcha-order {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  padding: 0.75rem;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(7, 62, 110, 0.18);
  width: max-content;
  max-width: 100%;
}
.captcha-order:not([hidden]) {
  display: block;
}
.captcha-order-imgwrap {
  position: relative;
  width: fit-content;
}
.captcha-order-image {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: crosshair;
  user-select: none;
}
.captcha-order-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.captcha-order-badge {
  position: absolute;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.captcha-brand {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alert {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
}
.alert-error {
  background: #fdecec;
  color: #9c2626;
  border: 1px solid #f3caca;
}
.alert-success {
  background: #e8f8f1;
  color: #1f6b48;
  border: 1px solid #bfe9d5;
}

/* ---------- Dashboard ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
  align-items: start;
}
@media (max-width: 800px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.usage-block .usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.usage-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--glacier);
  overflow: hidden;
  border: 1px solid var(--border);
}
.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}
.usage-bar-fill.usage-warning {
  background: linear-gradient(90deg, var(--warning), #f0b429);
}
.usage-bar-fill.usage-full {
  background: linear-gradient(90deg, var(--danger), #f06a6a);
}
.sidebar hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}
.plan-name {
  font-weight: 700;
  color: var(--primary-dark);
}

.main-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  min-height: 400px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.breadcrumbs {
  font-size: 0.95rem;
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--primary);
  font-weight: 600;
}
.breadcrumbs .sep {
  margin: 0 0.35rem;
  color: var(--border);
}

.panel-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--glacier);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: #ddf1fa;
}
.dropzone strong {
  color: var(--primary-dark);
}

#upload-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.upload-progress-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}
.upload-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.upload-cancel-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.upload-cancel-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.upload-progress-item .name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.upload-progress-item .bar {
  height: 6px;
  border-radius: 999px;
  background: var(--glacier);
  overflow: hidden;
}
.upload-progress-item .bar-fill {
  height: 100%;
  background: var(--primary);
}
.upload-progress-item.error .bar-fill {
  background: var(--danger);
}
.upload-progress-item.error .name {
  color: var(--danger);
}

table.file-table {
  width: 100%;
  border-collapse: collapse;
}
table.file-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
table.file-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.file-table tr:hover {
  background: var(--frost);
}
.item-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: white;
  font-weight: 700;
}
.item-icon.folder {
  background: linear-gradient(135deg, var(--accent), var(--primary));
}
.item-icon.file {
  background: var(--muted);
}
.item-name a.folder-link {
  font-weight: 600;
  color: var(--text);
}
.item-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
}
.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--glacier);
  color: var(--primary-dark);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  background: #dcf0f9;
}
.icon-btn-danger {
  color: var(--danger);
  background: var(--white);
  border-color: #f3caca;
  font-weight: 700;
}
.icon-btn-danger:hover {
  background: #fdecec;
}
.kebab-menu {
  position: relative;
}
.kebab-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(7, 62, 110, 0.15);
  min-width: 170px;
  padding: 0.3rem;
  flex-direction: column;
}
.kebab-dropdown:not([hidden]) {
  display: flex;
}
.kebab-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.kebab-item:hover {
  background: var(--glacier);
  text-decoration: none;
}
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 62, 110, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(7, 62, 110, 0.25);
}
.modal h3 {
  margin-top: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* ---------- Account page ---------- */
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--frost);
}
.plan-card.current {
  border-color: var(--accent);
  background: var(--glacier);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.plan-card-v {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--frost);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  opacity: 0.85;
}
.plan-card-v-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.plan-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.plan-price .muted {
  font-size: 0.85rem;
  font-weight: 500;
}
.plan-storage {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.plan-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.plan-benefits li {
  padding-left: 1.2rem;
  position: relative;
}
.plan-benefits li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.coming-soon-badge {
  background: var(--glacier);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-wrap[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
}

footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}
