/* Vokal - style */
:root {
  --green: #2f8f6b;
  --green-dark: #1f6b4e;
  --accent: #e8a14c;
  --ink: #26322c;
  --muted: #5c6b63;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.55);
  --shadow: 0 10px 40px rgba(40, 70, 55, 0.16);
  --input-bg: rgba(255, 255, 255, 0.78);
  --footer-bg: rgba(255, 255, 255, 0.5);
  --nav-bg: rgba(255, 255, 255, 0.55);
  --btn-text: #fff;
}
body.night {
  --ink: #eef4f0;
  --muted: #a9bcb1;
  --card-bg: rgba(18, 26, 24, 0.62);
  --card-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --input-bg: rgba(255, 255, 255, 0.08);
  --footer-bg: rgba(10, 16, 14, 0.45);
  --nav-bg: rgba(10, 16, 14, 0.4);
  --btn-text: #0d1411;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  transition: color .3s ease;
  overflow-x: hidden;
}

/* fullscreen background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("bg.jpg") center / cover no-repeat;
  filter: none;
  transition: filter .5s ease;
}
body.night .bg { filter: brightness(.55) saturate(.85); }
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0.22) 100%);
  pointer-events: none;
  transition: background .5s ease;
}
body.night .bg-overlay { background: linear-gradient(180deg, rgba(8,12,18,0.22) 0%, rgba(8,12,18,0.32) 100%); }

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

/* nav */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  transition: background .3s ease;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 24px; height: 24px; }
.nav-links { display: flex; align-items: center; gap: 10px; font-size: 13.5px; flex-wrap: nowrap; white-space: nowrap; }
.nav-links a { color: var(--ink); font-weight: 600; }
.nav-links a:hover { color: var(--green); text-decoration: none; }
.nav-links .btn { white-space: nowrap; }
#authArea { display: inline-flex; align-items: center; gap: 8px; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--green);
  color: var(--btn-text);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(47,143,107,0.35); text-decoration: none; }
.btn.ghost { background: transparent; border: 1.5px solid var(--green); color: var(--green); }
.btn.ghost:hover { background: rgba(47,143,107,0.12); box-shadow: none; }
.btn.accent { background: var(--accent); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
#themeToggle {
  background: transparent;
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  width: 34px; height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink);
  backdrop-filter: blur(8px);
  padding: 0;
}
.icon-btn { background: transparent; border: 1.5px solid var(--card-border); border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--ink); position: relative; padding: 0; }
.lang-switch { font-size: 13px; padding: 5px 8px; border-radius: 10px; border: 1.5px solid var(--card-border); background: var(--card-bg); color: var(--ink); cursor: pointer; max-width: 118px; }

/* hero */
.hero { text-align: center; padding: 70px 24px 30px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 900; letter-spacing: -1px; line-height: 1.12; }
.hero h1 .grad { background: linear-gradient(90deg, #1f6b4e, #3aa67d, #e8a14c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin-top: 14px; font-size: 18px; color: var(--muted); max-width: 640px; margin-inline: auto; }

/* container */
.container { max-width: 1080px; margin: 0 auto; padding: 20px 20px 60px; }

/* card / workspace */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 28px;
  transition: background .3s ease, border-color .3s ease;
}
.workspace { max-width: 860px; margin: 34px auto 0; }
.workspace label { display: block; font-weight: 700; font-size: 14.5px; margin: 18px 0 8px; }
textarea#ttsText {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  border-radius: 14px;
  border: 1.5px solid var(--card-border);
  background: var(--input-bg);
  color: var(--ink);
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color .2s ease, background .3s ease;
}
textarea#ttsText:focus { border-color: var(--green); }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.control { display: flex; flex-direction: column; gap: 8px; }
.control span { font-size: 13.5px; font-weight: 700; color: var(--muted); }
select, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--card-border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s ease;
}
select:focus, input:focus { border-color: var(--green); }
input[type="range"] { accent-color: var(--green); width: 100%; }
.counter { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
#generateBtn { width: 100%; margin-top: 20px; padding: 15px; font-size: 17px; border-radius: 14px; }

/* result */
.result { display: none; margin-top: 22px; padding: 18px; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--card-border); }
.result.show { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result audio { width: 100%; outline: none; }
.result .row { display: flex; gap: 12px; margin-top: 14px; }
.spinner {
  width: 22px; height: 22px; border: 3px solid rgba(47,143,107,.25); border-top-color: var(--green);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 54px; }
.feature { text-align: left; }
.feature .ic { font-size: 30px; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* voices preview */
.voices-section { margin-top: 56px; }
.voices-section h2 { font-size: 26px; margin-bottom: 8px; }
.voices-section > p { color: var(--muted); margin-bottom: 22px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.voice-chip { background: var(--input-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: transform .15s ease, border-color .2s ease; display: flex; align-items: center; gap: 10px; }
.voice-chip:hover { transform: translateY(-2px); border-color: var(--green); }
.voice-chip .flag { font-size: 22px; }
.voice-chip .vname { font-weight: 700; font-size: 14.5px; }
.voice-chip .vmeta { font-size: 12px; color: var(--muted); }

/* ad slot */
.ad-slot { margin: 50px auto; max-width: 860px; min-height: 120px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--input-bg); border: 1px dashed var(--card-border); color: var(--muted); font-size: 13px; }

/* auth pages */
.auth-wrap { max-width: 430px; margin: 70px auto 40px; }
.auth-wrap h2 { font-size: 28px; margin-bottom: 6px; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 14.5px; }
.auth-wrap .field { margin-bottom: 16px; }
.auth-wrap .field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 7px; }
.auth-wrap .btn { width: 100%; }
.err { color: #d1453b; font-size: 13.5px; margin-top: 10px; min-height: 18px; font-weight: 600; }
.ok { color: var(--green); font-size: 13.5px; margin-top: 10px; min-height: 18px; font-weight: 600; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* account */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 22px; }
.stat { background: var(--input-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 18px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 900; color: var(--green); }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.progress { height: 10px; border-radius: 999px; background: rgba(127,127,127,.2); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2f8f6b, #5ec09a); width: 0%; transition: width .4s ease; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.pill.free { background: rgba(127,127,127,.16); color: var(--muted); }
.pill.pro { background: linear-gradient(90deg, #2f8f6b, #3aa67d); color: #fff; }
.pill.basic { background: linear-gradient(90deg, #3a7ca6, #5b9cc4); color: #fff; }
.pill.premium { background: linear-gradient(90deg, #a6782f, #c79a4b); color: #fff; }
.pill.admin { background: var(--accent); color: #fff; }
.pill.banned { background: #d1453b; color: #fff; }

/* pricing */
.section-title { text-align: center; margin: 10px 0 26px; font-size: 30px; }
.pricing { margin: 46px 0 10px; }
.pricing > h2 { text-align: center; font-size: 30px; }
.pricing > p { text-align: center; color: var(--muted); margin-bottom: 26px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.plan-card { position: relative; padding: 26px 24px; text-align: center; }
.plan-card.hot { border-color: var(--green); box-shadow: 0 14px 40px rgba(47,143,107,.18); }
.plan-card.current { outline: 2px dashed var(--green); }
.plan-card h3 { font-size: 19px; margin-bottom: 8px; }
.plan-price { font-size: 38px; font-weight: 900; color: var(--ink); }
.plan-dur { font-size: 13.5px; color: var(--muted); margin: 4px 0 16px; }
.plan-card ul { list-style: none; text-align: left; margin: 14px 0 20px; padding: 0; }
.plan-card li { padding: 6px 0 6px 22px; position: relative; font-size: 13.5px; color: var(--muted); }
.plan-card li::before { content: "✓"; position: absolute; left: 2px; color: var(--green); font-weight: 800; }
.plan-badge { position: absolute; top: -10px; right: 14px; background: linear-gradient(135deg, #2f8f6b, #5ec09a); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; box-shadow: 0 4px 12px rgba(47,143,107,.4); }

/* account profile */
.profile-row { display: flex; gap: 18px; align-items: center; margin: 18px 0; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #2f8f6b, #5ec09a); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 900; flex-shrink: 0; }
.profile-fields { flex: 1; }
.profile-fields label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.meta-grid > div { background: rgba(127,127,127,.07); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; }
.meta-grid .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.meta-grid span:last-child { font-weight: 700; color: var(--ink); }

/* admin */
.admin-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th, table.users td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--card-border); }
table.users th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.users select { width: auto; padding: 6px 10px; font-size: 13px; }
.mini-btn { padding: 6px 12px; border-radius: 9px; border: none; font-size: 12.5px; font-weight: 700; cursor: pointer; background: rgba(47,143,107,.15); color: var(--green); }
.mini-btn.danger { background: rgba(209,69,59,.13); color: #d1453b; }

/* content pages */
.page { max-width: 800px; margin: 50px auto 60px; }
.page h1 { font-size: 32px; margin-bottom: 18px; }
.page h2 { font-size: 20px; margin: 26px 0 10px; }
.page p, .page li { color: var(--muted); line-height: 1.75; font-size: 15px; margin-bottom: 10px; }
.page ul { padding-left: 22px; }

/* footer */
footer { margin-top: 70px; padding: 34px 24px; background: var(--footer-bg); backdrop-filter: blur(12px); border-top: 1px solid var(--card-border); }
.foot-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; align-items: center; }
.foot-links { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }
.foot-links a { color: var(--muted); }
.copyright { font-size: 13px; color: var(--muted); }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px); background: rgba(30,40,35,.92); color: #fff; padding: 13px 22px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 99; transition: transform .3s ease; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* responsive */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  nav { padding: 12px 16px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.btn) { display: none; }
  .controls { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .card { padding: 20px; }
  table.users { font-size: 12.5px; }
  table.users th:nth-child(4), table.users td:nth-child(4) { display: none; }
}
@media (max-width: 460px) {
  .features { grid-template-columns: 1fr; }
}

/* ---------- global: honor hidden attr (popups must actually hide) ---------- */
[hidden] { display: none !important; }

/* ---------- new: logo + shine ---------- */
.brand { position: relative; }
.logo-wrap { position: relative; display: inline-flex; border-radius: 14px; overflow: hidden; }
.logo-wrap .shine {
  position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  animation: shineSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shineSweep {
  0% { left: -60%; }
  55% { left: 130%; }
  100% { left: 130%; }
}

/* ---------- new: lang switch & icon buttons ---------- */
body.night .lang-switch { background: rgba(255,255,255,.08); }
.icon-btn:hover { background: rgba(127,127,127,.12); }
.bell-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: #e05252; box-shadow: 0 0 0 2px var(--card-bg);
}

/* ---------- new: bell panel ---------- */
.bell-panel {
  position: fixed; top: 54px; right: 18px; width: min(360px, 92vw); max-height: 60vh;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18); z-index: 90; display: flex; flex-direction: column; overflow: hidden;
}
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--card-border); font-size: 15px; }
.bell-body { overflow-y: auto; padding: 6px 0; }
.bell-item { padding: 12px 16px; border-bottom: 1px solid var(--card-border); }
.bell-item.new { background: rgba(47,143,107,.06); }
.bell-item-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.bell-item-body { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.bell-item-time { font-size: 12px; color: var(--muted); opacity: .75; margin-top: 5px; }
.mini-x { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 2px 6px; border-radius: 8px; }
.mini-x:hover { background: rgba(127,127,127,.15); }

/* ---------- new: announce modal ---------- */
.announce-modal {
  position: fixed; inset: 0; background: rgba(10,18,14,.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.announce-card { width: min(430px, 94vw); animation: popIn .28s ease; }
@keyframes popIn { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.announce-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 12px; }
.announce-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--ink); }
.announce-msg { font-size: 14px; color: var(--muted); line-height: 1.7; }
.announce-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.dismiss-row { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* ---------- new: workspace note / pass / history / notices ---------- */
.ws-note { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.muted { color: var(--muted); font-size: 14px; }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.hist-item { padding: 12px 0; border-bottom: 1px dashed var(--card-border); }
.hist-text { font-size: 14px; color: var(--ink); }
.hist-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.notice-form { background: rgba(127,127,127,.06); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.notice-type-row { display: flex; gap: 18px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.notice-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--card-border); }
.notice-main { flex: 1; }
