/* Foli·Share — "Cloud": interfaccia di navigazione file.
   Scoperto sotto .cloud apposta: non tocca le pagine non ancora ridisegnate
   (Condivisioni, Invia, Sicurezza, login) che restano su style.css. */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk/CabinetGrotesk-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk/CabinetGrotesk-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk/CabinetGrotesk-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("fonts/cabinet-grotesk/CabinetGrotesk-Black.woff2") format("woff2");
  font-weight: 900; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700; font-display: swap;
}

.cloud {
  --cream: #f8f4e4;
  --ink: #0a0a0a;
  --ink-soft: #66645f;
  --ink-faint: #a7a49a;
  --blue: #b2cbf4;
  --blue-deep: #1b22a4;
  --pink: #ffb9dd;
  --mustard: #ffae22;
  --white: #ffffff;
  --line: #191919;
  --danger: #c0392b;
  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sm: 10px;
  --font-display: "Cabinet Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  min-height: 100vh;
}

.cloud, .cloud input, .cloud button, .cloud select {
  font-family: var(--font-mono);
}

.cloud a { color: inherit; }

.cloud .cloud-shell {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-areas: "topbar topbar" "sidebar main";
  column-gap: 24px;
  row-gap: 0;
  max-width: 1720px;
  margin: 0 auto;
  padding: 40px 40px 24px;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.cloud .sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}
.cloud .sidebar-nav {
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cloud .nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.cloud .nav-btn svg { width: 20px; height: 20px; }
.cloud .nav-btn.is-active { background: var(--blue); }
.cloud .nav-btn.is-disabled { color: var(--ink-faint); cursor: default; }
.cloud .nav-btn:not(.is-disabled):not(.is-active):hover { background: var(--cream); }
.cloud .sidebar-bell {
  background: var(--white);
  border-radius: 999px;
  padding: 14px 0;
  display: flex;
  justify-content: center;
}

/* ---------- Topbar ---------- */
.cloud .cloud-main { grid-area: main; min-width: 0; }
.cloud .topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.cloud .topbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-right: 24px;
}
.cloud .topbar-logo { width: 26px; height: 26px; flex-shrink: 0; object-fit: contain; }
.cloud .topbar-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.cloud .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.cloud .pill-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.cloud .pill-btn.is-primary { background: var(--blue); }
.cloud .pill-btn:disabled, .cloud .pill-btn.is-disabled {
  color: var(--ink-faint); cursor: default;
}
.cloud .pill-btn:not(:disabled):not(.is-disabled):hover { filter: brightness(0.97); }

.cloud .search-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 180px;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 10px;
}
.cloud .search-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--mustard);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  cursor: pointer;
}
.cloud .search-btn svg { width: 18px; height: 18px; }
.cloud .search-input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
  padding-right: 14px;
}

.cloud .avatar-btn {
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--mustard);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

/* ---------- Breadcrumb / screen head ---------- */
.cloud .cloud-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  min-height: 32px;
}
.cloud .cloud-head svg { width: 22px; height: 22px; color: var(--blue-deep); }
.cloud .cloud-head .crumb-name {
  font-weight: 700;
  font-size: 20px;
}
.cloud .cloud-head .sel-count {
  font-weight: 700;
  font-size: 16px;
}
.cloud .cloud-head .sel-count strong { display: inline-block; margin-right: 4px; }

/* ---------- View switcher ---------- */
.cloud .view-toggle { display: flex; gap: 4px; position: relative; margin-left: auto; }
.cloud .view-toggle-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--radius-sm);
  color: var(--ink); cursor: pointer;
}
.cloud .view-toggle-btn svg { width: 18px; height: 18px; }
.cloud .view-toggle-btn.is-active { color: var(--blue-deep); }
.cloud .view-toggle-btn:hover { background: var(--white); }

/* ---------- File table (list view) ---------- */
.cloud .file-table { width: 100%; }
.cloud .file-thead {
  display: grid;
  grid-template-columns: 1fr 220px 160px 140px 80px;
  gap: 20px;
  padding: 0 18px 18px;
  font-weight: 700;
  font-size: 14px;
  align-items: center;
}
.cloud .file-thead > div { border-left: 1.5px solid var(--ink); padding-left: 20px; }
.cloud .file-thead > div:first-child { border-left: none; padding-left: 0; display: flex; align-items: center; gap: 10px; }

.cloud .file-row {
  display: grid;
  grid-template-columns: 1fr 220px 160px 140px 80px;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-top: 1.5px solid var(--ink);
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
}
.cloud .file-list > .file-row:last-child { border-bottom: 1.5px solid var(--ink); }
.cloud .file-row.is-selected, .cloud .file-row:hover { background: rgba(25, 25, 25, 0.04); }
.cloud .file-row.is-selected .fr-name, .cloud .file-row.is-selected .fr-icon { font-weight: 700; }

.cloud .fr-name-col { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cloud .fr-check {
  width: 18px; height: 18px;
  accent-color: var(--blue-deep);
  flex-shrink: 0;
  opacity: 0;
}
.cloud .file-row:hover .fr-check,
.cloud .file-row.is-selected .fr-check,
.cloud .fr-check:focus-visible {
  opacity: 1;
}
.cloud .fr-icon { flex-shrink: 0; display: flex; }
.cloud .fr-icon svg { width: 19px; height: 19px; }
.cloud .fr-icon.is-folder { color: var(--ink); }
.cloud .fr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud .fr-badges { display: flex; gap: 10px; margin-left: auto; padding-left: 10px; flex-shrink: 0; position: relative; }
.cloud .fr-badges svg { width: 17px; height: 17px; }
.cloud .fr-shared { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); flex-shrink: 0; }
.cloud .fr-menu-btn {
  border: none; background: transparent; cursor: pointer;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); border-radius: var(--radius-sm); flex-shrink: 0; position: relative;
  opacity: 0;
}
.cloud .file-row:hover .fr-menu-btn,
.cloud .file-row.is-selected .fr-menu-btn,
.cloud .fr-menu-btn:focus-visible,
.cloud .fr-menu-btn[aria-expanded="true"] {
  opacity: 1;
}
.cloud .fr-menu-btn:hover { background: var(--white); }
.cloud .fr-menu-btn svg { width: 17px; height: 17px; }

.cloud .empty-state {
  padding: 60px 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Grid / icons view ---------- */
.cloud .file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 36px 24px;
}
.cloud .grid-item { text-decoration: none; color: var(--ink); position: relative; display: block; }
.cloud .grid-folder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cloud .grid-folder svg { width: 100%; height: 100%; display: block; }
.cloud .grid-item.is-selected .grid-folder { background: var(--blue); border-radius: var(--radius-sm); padding: 14%; }
.cloud .grid-badge {
  position: absolute;
  bottom: 14%;
  right: 8%;
  width: 22px; height: 22px;
  color: var(--ink);
}
.cloud .grid-badge svg { width: 100%; height: 100%; display: block; }
.cloud .grid-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 14px;
  gap: 8px;
}
.cloud .grid-meta .fr-name { font-weight: 500; }
.cloud .grid-size { color: var(--ink-soft); flex-shrink: 0; }
.cloud .grid-check {
  position: absolute;
  top: 4px; left: 4px;
  z-index: 2;
}

/* ---------- Context menu ---------- */
.cloud .ctx-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 40px rgba(25,25,25,0.16);
  padding: 10px 0;
  min-width: 220px;
}
.cloud .ctx-menu[hidden] { display: none; }
.cloud .ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 22px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.cloud .ctx-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.cloud .ctx-item:hover { background: var(--cream); }
.cloud .ctx-item.is-danger { color: var(--danger); }
.cloud .ctx-sep { height: 1px; background: #ece8d9; margin: 8px 0; }
.cloud .ctx-item .ctx-arrow { margin-left: auto; }

/* ---------- Options menu (colonne / vista) ---------- */
.cloud .opt-menu {
  position: absolute;
  z-index: 40;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 40px rgba(25,25,25,0.16);
  padding: 18px 22px;
  min-width: 210px;
}
.cloud .opt-menu[hidden] { display: none; }
.cloud .opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-mono);
}
.cloud .opt-row svg { width: 16px; height: 16px; }
.cloud .opt-dot {
  width: 9px; height: 9px; border-radius: 999px;
  border: 1.4px solid var(--ink);
  flex-shrink: 0;
}
.cloud .opt-dot.is-on { background: var(--ink); }
.cloud .opt-row.is-disabled { color: var(--ink-faint); cursor: default; }
.cloud .opt-row.is-disabled .opt-dot { border-color: var(--ink-faint); }

/* ---------- Storage bar ---------- */
.cloud .storage-bar-wrap { margin-top: auto; padding-top: 56px; }
.cloud .storage-labels {
  display: flex;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.cloud .storage-track {
  height: 30px;
  border-radius: var(--radius-pill);
  background: repeating-linear-gradient(
    -45deg, #efece0, #efece0 6px, #f8f4e4 6px, #f8f4e4 12px
  );
  display: flex;
  overflow: hidden;
  border: 1.5px solid #ece8d9;
}
.cloud .storage-seg { height: 100%; display: flex; align-items: center; padding-left: 14px; font-size: 12px; font-weight: 700; }
.cloud .storage-seg.seg-archive { background: var(--blue); }
.cloud .storage-seg.seg-zips { background: var(--pink); }
.cloud .storage-cap { font-weight: 700; color: var(--blue-deep); font-size: 13px; flex-shrink: 0; margin-left: 12px; align-self: center; }
.cloud .storage-underline { height: 3px; background: var(--mustard); border-radius: 999px; margin-top: 8px; }
.cloud .storage-total-label { text-align: center; font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.cloud .cloud-footer {
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 18px;
}

/* ---------- Upload dropzone / selection bar (riuso concetti esistenti) ---------- */
.cloud .cloud-dropzone {
  border: 1.5px dashed var(--ink-faint);
  border-radius: var(--radius-card);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
}
.cloud .cloud-dropzone:hover { border-color: var(--ink); color: var(--ink); }
.cloud .cloud-dropzone svg { width: 20px; height: 20px; flex-shrink: 0; }
.cloud .cloud-dropzone.is-dragover { background: var(--white); border-color: var(--blue-deep); color: var(--ink); }
.cloud .cloud-dropzone.is-lg { flex-direction: column; padding: 46px 20px; text-align: center; }
.cloud .cloud-dropzone.is-lg svg { width: 30px; height: 30px; }
.cloud .cloud-dropzone .dz-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.cloud .cloud-dropzone .dz-sub { font-size: 13px; }

.cloud .cloud-field { margin-bottom: 22px; }
.cloud .cloud-flabel { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; }

.cloud .chip-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.cloud .chip-radio { position: absolute; opacity: 0; pointer-events: none; }
.cloud .chip {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid #ddd8c4;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--white);
}
.cloud .chip-radio:checked + .chip { background: var(--blue); border-color: var(--blue); }
.cloud .chip-radio:focus-visible + .chip { outline: 2px solid var(--blue-deep); outline-offset: 2px; }

.cloud .cloud-toggle { margin-bottom: 18px; }
.cloud .toggle-cb { position: absolute; opacity: 0; pointer-events: none; }
.cloud .toggle-head { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 14px; }
.cloud .switch-visual {
  width: 38px; height: 22px;
  border-radius: 999px;
  background: #ddd8c4;
  position: relative;
  flex-shrink: 0;
  transition: background .15s;
}
.cloud .switch-visual .track {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--white);
  transition: transform .15s;
}
.cloud .toggle-cb:checked + .toggle-head .switch-visual { background: var(--blue-deep); }
.cloud .toggle-cb:checked + .toggle-head .switch-visual .track { transform: translateX(16px); }
.cloud .toggle-body { display: none; margin: 10px 0 0 48px; }
.cloud .toggle-cb:checked ~ .toggle-body { display: block; }

.cloud .slug-row { display: flex; align-items: center; background: var(--white); border-radius: var(--radius-sm); border: 1.5px solid #ddd8c4; overflow: hidden; }
.cloud .slug-prefix { padding: 11px 0 11px 14px; color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.cloud .slug-input { border: none; background: transparent; padding: 11px 14px 11px 4px; font-family: var(--font-mono); font-size: 14px; flex: 1; min-width: 0; }
.cloud .slug-input:focus { outline: none; }

.cloud .picked-list { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.cloud .picked-item { background: var(--cream); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; display: flex; justify-content: space-between; }

/* ---------- Card di contenuto generica (Sicurezza, Condivisioni, Invia, dettaglio) ---------- */
.cloud .cloud-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  margin-bottom: 20px;
}
.cloud .cloud-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 6px;
}
.cloud .cloud-card .lede { color: var(--ink-soft); font-size: 14px; margin: 0; }
.cloud .cloud-rule { height: 1px; background: #ece8d9; border: none; margin: 22px 0; }
.cloud .cloud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Bottoni di contenuto (dentro le card, distinti dalle pillole della topbar) ---------- */
.cloud .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.cloud .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.cloud .btn:hover { background: var(--cream); }
.cloud .btn-primary { background: var(--blue); border-color: var(--blue); }
.cloud .btn-primary:hover { filter: brightness(0.97); }
.cloud .btn-danger { border-color: var(--danger); color: var(--danger); }
.cloud .btn-danger:hover { background: #fbecea; }
.cloud .btn-sm { padding: 7px 13px; font-size: 13px; }

.cloud .cloud-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #ddd8c4;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
}
.cloud .cloud-input:focus { outline: none; border-color: var(--blue-deep); }

.cloud .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
}
.cloud .badge svg { width: 12px; height: 12px; }
.cloud .badge-good { background: #e3f3e9; color: #1e7a44; }
.cloud .badge-warn { background: #fdf0dc; color: #9a6414; }

.cloud .otp-input {
  font-size: 22px;
  letter-spacing: 6px;
  text-align: center;
  max-width: 220px;
}
.cloud .codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.cloud .code-chip {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .cloud .cloud-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main" "sidebar";
    padding: 20px;
  }
  .cloud .sidebar { flex-direction: row; }
  .cloud .sidebar-nav { flex-direction: row; }
  .cloud .sidebar-bell { display: none; }
  .cloud .topbar-title { font-size: 32px; }
  .cloud .file-thead { display: none; }
  .cloud .file-row { grid-template-columns: 1fr; gap: 6px; }
}
