@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #07090e;
  --surface: #0f131c;
  --surface-2: #151a25;
  --line: rgba(255, 255, 255, .09);
  --muted: #929aaa;
  --text: #f4f6fa;
  --accent: #ff9b50;
  --accent-2: #ffbd73;
  --blue: #7c9cff;
  --danger: #ff6f78;
  --success: #66d6a4;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 76% -10%, rgba(255, 155, 80, .13), transparent 30%),
              radial-gradient(circle at -10% 40%, rgba(124, 156, 255, .08), transparent 28%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.shell { min-height: 100vh; }
.nav { height: 76px; display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: auto; padding: 0 26px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 800 20px/1 Manrope, sans-serif; letter-spacing: -.04em; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; background: linear-gradient(145deg, #202531, #0d1017); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.brand-mark::after { content: ""; width: 12px; height: 12px; border: 3px solid var(--accent); border-left-color: transparent; border-radius: 50%; transform: rotate(-40deg); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links > a, .nav-user { color: var(--muted); padding: 10px 13px; font-size: 14px; font-weight: 600; border-radius: 10px; }
.nav-links > a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.button { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 17px; min-height: 43px; border-radius: 11px; background: var(--accent); color: #17100a; font-weight: 700; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); background: var(--accent-2); }
.button.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
.button.secondary:hover { background: rgba(255,255,255,.05); }
.button.ghost { background: transparent; color: var(--muted); padding-inline: 10px; }
.button.danger { background: rgba(255,111,120,.12); color: #ff9299; border: 1px solid rgba(255,111,120,.22); }
.button.small { min-height: 34px; padding: 7px 11px; border-radius: 8px; font-size: 13px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.hero { max-width: 1180px; min-height: 680px; margin: auto; padding: 110px 26px 80px; position: relative; overflow: hidden; }
.hero-orbit { position: absolute; right: -100px; top: 40px; width: 590px; height: 590px; border: 1px solid rgba(255,255,255,.045); border-radius: 50%; }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.05); border-radius: 50%; inset: 75px; }
.hero-orbit::after { inset: 160px; background: radial-gradient(circle, rgba(255,155,80,.22), transparent 65%); }
.hero-copy { max-width: 710px; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 800 clamp(54px, 9vw, 108px)/.91 Manrope, sans-serif; letter-spacing: -.075em; margin: 27px 0 32px; }
h1 span { color: var(--muted); }
.hero-copy > p { max-width: 610px; color: #aab1bf; font-size: 19px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; }
.hero-note { display: flex; align-items: center; gap: 9px; color: #747c8c; font-size: 13px; margin-top: 25px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(102,214,164,.1); }

.section { max-width: 1180px; margin: auto; padding: 110px 26px; }
.section-head { max-width: 650px; margin-bottom: 50px; }
.section h2 { font: 700 clamp(36px, 5vw, 58px)/1.05 Manrope, sans-serif; letter-spacing: -.055em; margin: 16px 0; }
.section-head p { color: var(--muted); font-size: 17px; line-height: 1.65; }
.rank-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.rank-card { min-height: 210px; padding: 21px; border: 1px solid var(--line); background: rgba(15,19,28,.72); border-radius: 17px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.rank-card::before { content: ""; height: 3px; position: absolute; inset: 0 0 auto; background: var(--rank); opacity: .85; }
.rank-card .rank-number { color: #646b78; font: 600 11px Manrope; letter-spacing: .12em; }
.rank-card h3 { margin: auto 0 12px; font: 700 18px Manrope; }
.rank-card p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.feature-grid { display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 14px; }
.feature-card { padding: 30px; min-height: 270px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(22,27,39,.88), rgba(12,15,22,.88)); }
.feature-card:first-child { grid-row: span 2; min-height: 554px; }
.feature-icon { width: 41px; height: 41px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,155,80,.1); color: var(--accent); font-weight: 800; margin-bottom: 80px; }
.feature-card:first-child .feature-icon { margin-bottom: 260px; }
.feature-card h3 { font: 700 21px Manrope; margin-bottom: 10px; }
.feature-card p { color: var(--muted); line-height: 1.6; margin: 0; }
.cta { padding: 70px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(120deg, rgba(255,155,80,.12), rgba(15,19,28,.85) 42%, rgba(124,156,255,.08)); display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.cta h2 { margin: 0; max-width: 580px; }
.footer { max-width: 1180px; margin: auto; padding: 35px 26px 48px; color: #666e7d; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 13px; }

.auth-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { padding: clamp(40px, 7vw, 100px); display: flex; flex-direction: column; justify-content: flex-end; border-right: 1px solid var(--line); background: linear-gradient(145deg, rgba(124,156,255,.1), transparent 42%), radial-gradient(circle at 70% 70%, rgba(255,155,80,.15), transparent 30%); }
.auth-art h1 { font-size: clamp(52px, 7vw, 92px); max-width: 650px; }
.auth-art p { max-width: 500px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.auth-form-wrap { display: grid; place-items: center; padding: 50px 28px; }
.auth-form { width: min(470px, 100%); }
.auth-form h2 { font: 700 36px Manrope; letter-spacing: -.04em; margin-bottom: 10px; }
.auth-form > p { color: var(--muted); margin-bottom: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; color: #b9bfca; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.input-wrap { position: relative; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; min-height: 47px; padding: 11px 13px; background: var(--surface); color: var(--text); outline: none; }
input:focus, select:focus { border-color: rgba(255,155,80,.65); box-shadow: 0 0 0 3px rgba(255,155,80,.08); }
.input-wrap input { padding-right: 70px; }
.toggle-password { position: absolute; right: 7px; top: 6px; height: 35px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.field-note { color: #737b8a; font-size: 11px; line-height: 1.45; margin-top: 7px; }
.strength { height: 3px; background: var(--surface-2); border-radius: 4px; margin-top: 9px; overflow: hidden; }
.strength span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.profile-picker { display: flex; gap: 13px; align-items: center; padding: 11px; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; }
.avatar { flex: 0 0 auto; width: 43px; height: 43px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); font-weight: 800; border: 1px solid var(--line); }
.profile-picker input { min-height: 0; padding: 0; border: 0; background: none; font-size: 12px; }
.form-error { display: none; color: #ff9ca2; background: rgba(255,111,120,.08); border: 1px solid rgba(255,111,120,.18); padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 15px; }
.form-error.visible { display: block; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 20px; }
.auth-switch a { color: var(--accent-2); font-weight: 600; }

.app-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 27px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: rgba(7,9,14,.8); backdrop-filter: blur(18px); }
.side-nav { display: grid; gap: 5px; margin-top: 46px; }
.side-nav a { display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.side-nav a:hover, .side-nav a.active { color: var(--text); background: var(--surface-2); }
.side-icon { width: 19px; text-align: center; }
.sidebar-user { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sidebar-user .meta { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.app-main { padding: 38px clamp(24px, 4vw, 58px) 70px; min-width: 0; }
.app-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 36px; }
.app-header h1 { font-size: clamp(34px, 4vw, 52px); margin: 0 0 8px; letter-spacing: -.055em; }
.app-header p { color: var(--muted); }
.rank-pill { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: var(--accent-2); background: rgba(255,155,80,.09); border: 1px solid rgba(255,155,80,.17); font-size: 11px; font-weight: 700; }
.panel-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
.card { border: 1px solid var(--line); background: rgba(15,19,28,.75); border-radius: 16px; padding: 21px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.card h2 { font: 700 18px Manrope; margin: 0; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 55px 20px; }
.user-list { display: grid; gap: 8px; }
.user-row { display: grid; grid-template-columns: minmax(150px, 1fr) 140px auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.user-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-identity strong, .user-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.user-actions { display: flex; gap: 6px; }
.access-options { display: grid; gap: 9px; margin: 15px 0; }
.check { display: flex; align-items: center; gap: 9px; color: #bdc3cd; font-size: 13px; }
.check input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.invite-output { margin-top: 14px; display: flex; gap: 7px; }
.invite-output input { min-width: 0; font-size: 12px; }
.invite-list { margin-top: 16px; display: grid; gap: 8px; }
.invite-item { border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 11px; }

.cloud-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumbs button { border: 0; background: transparent; color: inherit; padding: 3px; cursor: pointer; }
.breadcrumbs button:hover { color: var(--text); }
.quota { margin-bottom: 18px; }
.quota-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.quota-bar { height: 5px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.drop-zone { min-height: 360px; border: 1px dashed rgba(255,255,255,.12); border-radius: 15px; padding: 14px; transition: border .15s, background .15s; }
.drop-zone.drag-over { border-color: var(--accent); background: rgba(255,155,80,.035); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.file-item { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 15px; cursor: pointer; text-align: left; color: var(--text); position: relative; }
.file-item:hover { border-color: rgba(255,255,255,.2); background: var(--surface-2); }
.file-item.drag-over { border-color: var(--accent); }
.file-icon { height: 70px; display: grid; place-items: center; font-size: 31px; color: var(--accent-2); }
.file-item strong, .file-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item strong { font-size: 13px; }
.file-item span { color: var(--muted); font-size: 10px; margin-top: 5px; }
.file-menu { position: absolute; right: 5px; top: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px; }
.drop-hint { min-height: 320px; display: grid; place-items: center; color: #676f7d; text-align: center; }
.drop-hint b { color: #9ca4b2; display: block; margin-bottom: 5px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.7); backdrop-filter: blur(7px); display: grid; place-items: center; padding: 22px; }
.modal { width: min(800px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: #0e121a; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 17px Manrope; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 23px; }
.preview { min-height: 430px; display: grid; place-items: center; padding: 20px; }
.preview img { max-height: 68vh; border-radius: 8px; }
.preview iframe { width: 100%; height: 65vh; border: 0; background: white; border-radius: 8px; }
.preview pre { width: 100%; align-self: stretch; overflow: auto; white-space: pre-wrap; color: #c9d0dc; font: 13px/1.65 ui-monospace, monospace; }
.preview-fallback { text-align: center; max-width: 400px; color: var(--muted); }
.preview-fallback .file-icon { font-size: 48px; }

.error-page { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 24px; text-align: center; }
.error-code { color: var(--accent); font: 700 12px Manrope; letter-spacing: .18em; text-transform: uppercase; }
.error-page h1 { font-size: clamp(55px, 9vw, 105px); margin: 20px 0; max-width: 900px; }
.error-page p { color: var(--muted); font-size: 18px; max-width: 590px; line-height: 1.6; }
.error-page .hero-actions { justify-content: center; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: #171c27; color: #dfe3ea; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,111,120,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .rank-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-card:first-child { grid-row: auto; grid-column: 1 / -1; min-height: 330px; }
  .feature-card:first-child .feature-icon { margin-bottom: 100px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-links .desktop-link { display: none; }
  .hero { padding-top: 70px; min-height: 610px; }
  .hero-orbit { opacity: .55; right: -370px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card:first-child { grid-column: auto; }
  .cta { padding: 40px 24px; flex-direction: column; align-items: flex-start; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
  .side-nav { margin: 18px 0 0; grid-template-columns: repeat(3, 1fr); }
  .side-nav a { justify-content: center; }
  .side-nav .side-icon { display: none; }
  .sidebar-user { display: none; }
  .app-main { padding: 28px 17px 60px; }
  .app-header { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .user-row { grid-template-columns: 1fr; }
  .cloud-toolbar { align-items: flex-start; flex-direction: column; }
  .footer { flex-direction: column; gap: 8px; }
}
