/* ODEK Pass — dark slate / indigo theme, matching vpn.odek.ua and meet-gw.odek.ua */
:root {
  --bg: #020617;            /* slate-950 */
  --card: rgba(15, 23, 42, .62);
  --card-border: #1e293b;   /* slate-800 */
  --input-bg: rgba(2, 6, 23, .6);
  --input-border: #334155;  /* slate-700 */
  --text: #f1f5f9;          /* slate-100 */
  --text-2: #cbd5e1;        /* slate-300 */
  --muted: #94a3b8;         /* slate-400 */
  --dim: #64748b;           /* slate-500 */
  --accent: #4f46e5;        /* indigo-600 */
  --accent-hi: #6366f1;     /* indigo-500 */
  --accent-soft: rgba(99, 102, 241, .14);
  --ring: rgba(99, 102, 241, .32);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.preload main, body.preload header, body.preload footer { visibility: hidden; }
::selection { background: rgba(99, 102, 241, .35); }

svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow-a { position: absolute; top: -12rem; left: 50%; width: 64rem; height: 42rem; transform: translateX(-50%); border-radius: 50%; background: rgba(79, 70, 229, .2); filter: blur(64px); }
.glow-b { position: absolute; right: 0; bottom: 0; width: 28rem; height: 28rem; transform: translate(33%, 33%); border-radius: 50%; background: rgba(109, 40, 217, .12); filter: blur(64px); }

/* ---- layout ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 760px; margin: 0 auto; padding: 22px 16px 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 20px rgba(49, 46, 129, .45); }
.brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand b { font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user { display: flex; align-items: center; gap: 6px; }
.user-name { color: var(--text-2); font-size: 14px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wrap { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 16px 24px; }
.center-box { display: grid; place-items: center; min-height: 50vh; }
.center { text-align: center; justify-content: center; }

.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 28px; color: var(--dim); font-size: 12.5px;
}
.e2e { display: inline-flex; align-items: center; gap: 6px; }
.e2e svg { width: 14px; height: 14px; color: var(--accent-hi); }
.lang-switch { display: flex; gap: 2px; }
.lang-switch a { color: var(--dim); text-decoration: none; padding: 3px 8px; border-radius: 6px; font-weight: 500; transition: color .15s, background .15s; }
.lang-switch a:hover { color: var(--text-2); }
.lang-switch a.active { color: var(--text); background: rgba(51, 65, 85, .5); }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: rise .35s ease both;
}
.card-narrow { max-width: 400px; margin: 4vh auto 0; }
.card-mid { max-width: 520px; margin: 4vh auto 0; }
.card-head { margin-bottom: 22px; }
.card-head h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.card-head .muted { margin: 4px 0 0; }
.card-foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--card-border); display: flex; }
.title-row { display: flex; align-items: center; gap: 14px; }
.title-row .badge-icon { margin: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.badge-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 15px; background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(49, 46, 129, .5);
}
.badge-icon svg { width: 25px; height: 25px; }
.badge-icon.ok { background: rgba(16, 185, 129, .14); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .3); }
.badge-icon.danger { background: rgba(244, 63, 94, .12); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .3); }

.muted { color: var(--muted); font-size: 14px; }
.hint { display: block; color: var(--dim); font-size: 12.5px; margin-top: 6px; }
p.hint.center { margin: 18px 0 0; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }

/* ---- form controls ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child, .opt-label { color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.opt-label { display: block; margin-bottom: 8px; }

input[type=text], input[type=password], input:not([type]), textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus { border-color: var(--accent-hi); box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.mono { font-family: var(--mono); font-size: 13.5px; }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.eye {
  position: absolute; top: 0; right: 0; bottom: 0; width: 40px; display: grid; place-items: center;
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.eye:hover { color: var(--text-2); }
.eye svg { width: 16px; height: 16px; }
.eye .eye-closed, .eye.on .eye-open { display: none; }
.eye.on .eye-closed { display: block; }

.offscreen { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -9999px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(49, 46, 129, .35); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-secondary { background: rgba(30, 41, 59, .7); color: var(--text-2); border-color: var(--input-border); }
.btn-secondary:hover { background: #1e293b; color: var(--text); border-color: #475569; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 18px; font-size: 15px; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn.copied { background: var(--ok); border-color: transparent; color: #fff; box-shadow: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); background: rgba(51, 65, 85, .45); }
.btn-ghost svg { width: 15px; height: 15px; }

.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.spinner.big { display: block; width: 32px; height: 32px; border-width: 3px; border-color: rgba(99, 102, 241, .25); border-top-color: var(--accent-hi); }
.btn.busy .spinner { display: block; }
.btn.busy .btn-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- tabs ---- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px;
  background: rgba(2, 6, 23, .55); border: 1px solid var(--card-border); border-radius: 12px;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text-2); }
.tab.active { background: #1e293b; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

/* ---- dropzone ---- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 166px; padding: 24px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--input-border); border-radius: 12px; background: var(--input-bg); color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.drop svg { width: 28px; height: 28px; color: var(--accent-hi); }
.drop u { color: var(--accent-hi); text-decoration: none; font-weight: 600; }
.drop:hover, .drop.over { border-color: var(--accent-hi); background: var(--accent-soft); }
.drop small { font-size: 12.5px; }

.file-chip {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px;
  border: 1px solid var(--input-border); border-radius: 12px; background: var(--input-bg);
}
.file-chip > svg { width: 26px; height: 26px; color: var(--accent-hi); }
.file-chip.big { padding: 18px; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- options ---- */
.options {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border: 1px solid var(--card-border); border-radius: 14px; background: rgba(2, 6, 23, .35);
}
.opt-row { padding-bottom: 12px; }

.segmented {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px;
  background: rgba(2, 6, 23, .55); border: 1px solid var(--card-border); border-radius: 12px;
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; padding: 8px 6px; border-radius: 8px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.segmented span:hover { color: var(--text-2); }
.segmented input:checked + span { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(49, 46, 129, .4); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

.switch-row {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; cursor: pointer;
  border-top: 1px solid rgba(30, 41, 59, .7);
}
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative; flex: none; width: 40px; height: 23px; margin-top: 1px; border-radius: 999px;
  background: #334155; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--ring); }
.switch-text { display: flex; flex-direction: column; }
.switch-text b { font-weight: 500; font-size: 14.5px; }
.switch-text small { color: var(--dim); font-size: 12.5px; }

.own-pw { padding: 12px 0 2px; animation: rise .25s ease both; }
.pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- alerts & chips ---- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px 14px;
  border-radius: 10px; font-size: 14px; line-height: 1.45;
}
.alert svg { width: 18px; height: 18px; margin-top: 1px; }
.alert-error { background: rgba(244, 63, 94, .1); border: 1px solid rgba(244, 63, 94, .3); color: #fecdd3; }
.alert-warn { background: rgba(245, 158, 11, .09); border: 1px solid rgba(245, 158, 11, .3); color: #fde68a; margin-bottom: 22px; }
.alert-warn svg { color: var(--warn); }
.wrap > .alert { margin-bottom: 16px; }
.card-mid .alert, .card-narrow .alert { margin-bottom: 14px; }
form .alert { margin-bottom: 0 !important; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: rgba(51, 65, 85, .45); color: var(--text-2); border: 1px solid rgba(71, 85, 105, .5);
}
.chip-warn { background: rgba(245, 158, 11, .12); color: #fcd34d; border-color: rgba(245, 158, 11, .3); }

/* ---- result ---- */
.out-row { display: flex; gap: 8px; }
.out-row input { flex: 1; min-width: 0; }
.out-row .btn { min-width: 132px; }
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.out-head .opt-label { margin: 0; }
input.key { color: #c7d2fe; letter-spacing: .02em; }
#secret-out { min-height: 110px; color: #e0e7ff; }

/* ---- not found ---- */
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reasons li {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--card-border); border-radius: 12px; background: rgba(2, 6, 23, .35);
}
.reasons li div { display: flex; flex-direction: column; }
.reasons b { font-weight: 600; font-size: 14.5px; }
.reasons small { color: var(--muted); font-size: 13px; }
.reason-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-hi); }
.reason-icon svg { width: 17px; height: 17px; }
.card-foot.center { justify-content: center; }

/* ---- responsive ---- */
@media (max-width: 600px) {
  .card { padding: 20px 16px; }
  .wrap { padding-top: 20px; }
  .segmented { grid-template-columns: repeat(2, 1fr); }
  .pw-grid { grid-template-columns: 1fr; }
  .out-row { flex-direction: column; }
  .out-row .btn { width: 100%; }
  .brand small { display: none; }
  .user-name { display: none; }
  .file-chip.big { flex-wrap: wrap; }
  .file-chip.big .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
