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

:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #12151d;
  --border: #272b36;
  --muted: #a2a8b7;
  --green: #a6f3bd;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: #f6f7fb;
  font-family: 'DM Sans', sans-serif;
}
a { color: inherit; text-decoration: none; }
.nav, footer {
  max-width: 1200px;
  margin: auto;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav { border-bottom: 1px solid #1d2029; }
.brand {
  font-family: Manrope, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -1px;
}
.brand span { color: var(--green); }
.nav-link { color: #d4d7e0; font-size: 13px; }
.hero {
  text-align: center;
  padding: 112px 20px 105px;
  background: radial-gradient(ellipse at 50% 5%, #1c2a2a 0, transparent 58%);
}
.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1, .preview-page > h1 {
  margin: 24px 0 18px;
  font: 800 clamp(40px, 6vw, 72px)/1.08 Manrope, sans-serif;
  letter-spacing: -3px;
}
.hero h1 span { color: var(--green); }
.hero p, .section-head p, .preview-page > p {
  color: var(--muted);
  max-width: 570px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 14px;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  padding: 14px 20px;
  border-radius: 8px;
  background: var(--green);
  color: #101a13;
  font-size: 13px;
  font-weight: 700;
}
.primary-btn span { font-size: 18px; }
.hero-note { color: #818899; font-size: 11px; margin-top: 20px; }
.templates { max-width: 1200px; margin: auto; padding: 45px 28px 90px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.section-head h2, .bottom-cta h2 { font: 700 36px Manrope, sans-serif; letter-spacing: -1.5px; margin: 12px 0; }
.section-head p { margin: 0; font-size: 13px; }
.count { color: #9097a8; font-size: 10px; letter-spacing: 1px; padding-bottom: 5px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.template-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.preview { display: block; position: relative; height: 280px; padding: 20px; overflow: hidden; }
.mock-nav { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: .7px; }
.mock-nav span { font-size: 7px; opacity: .7; }
.mock-content { max-width: 330px; margin: 50px auto 0; }
.mock-label { font-size: 8px; letter-spacing: 1.5px; opacity: .75; }
.mock-title { font: 800 clamp(24px, 3vw, 36px)/1.15 Manrope, sans-serif; letter-spacing: -1px; margin: 12px 0; }
.mock-line { height: 4px; width: 80px; border-radius: 8px; background: currentColor; opacity: .4; margin-bottom: 20px; }
.mock-button { display: inline-block; padding: 9px 12px; font-size: 8px; letter-spacing: .6px; font-weight: 700; border: 1px solid currentColor; border-radius: 4px; }
.preview-tag { position: absolute; bottom: 14px; right: 16px; font-size: 8px; letter-spacing: 1px; }
.card-info { display: flex; justify-content: space-between; align-items: center; padding: 20px; gap: 12px; }
.card-info h3 { font: 700 17px Manrope, sans-serif; margin-bottom: 7px; }
.card-info p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.arrow { font-size: 22px; color: var(--green); }
.aurora { background: linear-gradient(135deg, #e2fbef, #a5d4ce 50%, #9b9de5); color: #12262b; }
.midnight { background: radial-gradient(circle at 75% 20%, #45407c, #111322 62%); color: white; }
.minimal { background: #f3f0e9; color: #25251f; }
.vibrant { background: linear-gradient(135deg, #ffd16d, #ff936d 48%, #ef74aa); color: #32162b; }
.studio { background: linear-gradient(135deg, #d7e6fa, #f3f4f6); color: #1a2940; }
.bottom-cta { text-align: center; padding: 70px 20px 85px; border-top: 1px solid #20232c; background: #10131a; }
.bottom-cta p { color: var(--muted); max-width: 550px; margin: auto; font-size: 13px; line-height: 1.8; }
footer { border-top: 1px solid #20232c; color: var(--muted); font-size: 11px; }
.preview-page { max-width: 1000px; margin: auto; padding: 65px 25px 90px; text-align: center; }
.preview-page > h1 { font-size: 48px; margin: 14px 0; }
.large-preview { margin: 40px auto 0; text-align: left; min-height: 420px; border-radius: 14px; padding: 28px; }
.large-content { max-width: 520px; margin: 85px auto 40px; }
.large-content h2 { font: 800 clamp(36px, 6vw, 62px)/1.1 Manrope, sans-serif; letter-spacing: -2px; margin: 16px 0; }
.large-content p { max-width: 400px; font-size: 13px; line-height: 1.8; opacity: .8; }
.small-note { font-size: 11px; color: #8d95a5; margin-top: 25px; }
@media (max-width: 650px) {
  .hero { padding: 80px 20px; }
  .hero h1 { letter-spacing: -2px; }
  .templates { padding: 35px 16px 60px; }
  .template-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 29px; }
  .preview { height: 250px; }
  .nav, footer { padding: 20px 16px; }
  .brand { font-size: 19px; }
  .large-preview { padding: 20px; min-height: 360px; }
  .large-content { margin-top: 70px; }
}

.auth-wrap {
  min-height: 75vh;
  display: grid;
  place-items: center;
  padding: 50px 18px;
  background: radial-gradient(ellipse at 50% 15%, #1c2a2a 0, transparent 60%);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 35px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.auth-card h1, .dashboard h1 {
  font: 800 34px/1.15 Manrope, sans-serif;
  letter-spacing: -1.5px;
  margin: 15px 0 10px;
}
.auth-card > p, .dashboard-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.auth-card form { margin-top: 25px; }
.auth-card label, .project-form label {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
  color: #d9dce5;
}
.auth-card input, .project-form input, .project-form select {
  width: 100%;
  min-height: 45px;
  padding: 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0c0f15;
  color: #fff;
  font: inherit;
}
.auth-card input:focus, .project-form input:focus, .project-form select:focus {
  outline: 2px solid #75c990;
  outline-offset: 1px;
}
.form-hint, .auth-switch { color: var(--muted); font-size: 11px; line-height: 1.7; }
.form-submit { width: 100%; justify-content: space-between; cursor: pointer; border: 0; }
.auth-switch { margin-top: 24px; text-align: center; }
.auth-switch a { color: var(--green); font-weight: 700; }
.auth-error {
  padding: 12px;
  border: 1px solid #804747;
  border-radius: 7px;
  background: #351d22;
  color: #ffd2d2;
  font-size: 12px;
  margin-top: 18px;
}
.dashboard { max-width: 1050px; margin: auto; padding: 55px 24px 90px; }
.nav-actions { display: flex; align-items: center; gap: 15px; }
.nav-actions form { margin: 0; }
.user-email { font-size: 12px; color: var(--muted); }
.outline-btn {
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: #fff;
  border-radius: 7px;
  cursor: pointer;
}
.create-panel {
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  margin: 30px 0 45px;
}
.create-panel h2, .project-list h2 {
  font: 700 21px Manrope, sans-serif;
  margin: 0 0 10px;
}
.project-form { max-width: 650px; }
.project-form .primary-btn { cursor: pointer; border: 0; }
.project-list .section-head { align-items: center; }
.empty-state {
  padding: 35px;
  border: 1px dashed #3b414e;
  border-radius: 10px;
  text-align: center;
}
.empty-state p, .saved-card p { color: var(--muted); font-size: 12px; }
.saved-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.saved-card { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.saved-card h3 { margin: 15px 0 8px; font: 700 17px Manrope, sans-serif; overflow-wrap: anywhere; }
.saved-template { color: var(--green); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
@media (max-width: 600px) {
  .auth-card { padding: 24px; }
  .saved-grid { grid-template-columns: 1fr; }
  .nav-actions { gap: 8px; }
  .user-email { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

.project-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0c0f15;
  color: #fff;
  font: inherit;
  line-height: 1.6;
}
.project-form input[type="color"] {
  width: 80px;
  height: 45px;
  padding: 4px;
}
.success-message { color: var(--green); font-size: 13px; }
.public-link { color: var(--green); overflow-wrap: anywhere; }

/* AdNex Pages template previews */
.template-preview {
  --preview-accent: #a6f3bd;
  box-sizing: border-box;
  min-height: 300px;
  padding: 42px 24px;
  border: 1px solid #303442;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  text-align: center;
  color: #f8fafc;
  background: #10131c;
  overflow-wrap: anywhere;
}
.template-preview h2 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(27px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -1px;
}
.template-preview p {
  max-width: 560px;
  color: #b9bfce;
  line-height: 1.7;
  margin: 0;
}
.preview-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--preview-accent);
}
.preview-button {
  display: inline-block;
  margin-top: 8px;
  padding: 13px 21px;
  border-radius: 8px;
  background: var(--preview-accent);
  color: #10131c;
  font-weight: 800;
}

/* Aurora: atmospheric gradient */
.theme-aurora {
  background: radial-gradient(ellipse at top, #254d58, #121625 65%);
  border-color: #426875;
}

/* Midnight: sharp monochrome */
.theme-midnight {
  background: #050608;
  border: 1px solid #555b68;
  border-radius: 3px;
}
.theme-midnight .preview-button {
  border-radius: 3px;
}

/* Minimal: bright editorial layout */
.theme-minimal {
  background: #f7f5ef;
  color: #20211e;
  border-color: #e1ddd2;
  border-radius: 0;
}
.theme-minimal p { color: #62645e; }
.theme-minimal .preview-button { color: #fff; background: #20211e; }

/* Vibrant: vivid, energetic gradient */
.theme-vibrant {
  background: linear-gradient(135deg, #42146f, #a52a73 55%, #ef7847);
  border: 0;
}
.theme-vibrant .preview-label { color: #fff0a5; }
.theme-vibrant .preview-button { background: #fff0a5; }

/* Studio: polished business layout */
.theme-studio {
  background: #e9eef4;
  color: #15243b;
  border: 1px solid #c8d4e2;
  border-radius: 5px;
  align-items: flex-start;
  text-align: left;
}
.theme-studio .preview-label { color: #2457b2; }
.theme-studio p { color: #4e5c70; }
.theme-studio .preview-button { background: #2457b2; color: white; }

@media (max-width: 600px) {
  .template-preview { min-height: 260px; padding: 32px 18px; }
}

.published-hero {
  min-height: 75vh;
  display: grid;
  place-items: center;
  padding: 50px 20px;
}
.published-inner {
  width: min(100%, 900px);
  min-height: 420px;
}
.published-inner h1 {
  font: 800 clamp(36px, 7vw, 76px)/1.08 Manrope, sans-serif;
  letter-spacing: -2px;
}
.published-inner .preview-button {
  border: 0;
}

/* Divine-style Telegram landing page */
.divine-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(0, 190, 255, .20), transparent 43%),
    radial-gradient(ellipse at 85% 85%, rgba(90, 35, 170, .18), transparent 38%),
    var(--divine-bg, #030b1b);
  color: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 42px);
  box-sizing: border-box;
}
.divine-shell { width: 100%; max-width: 640px; margin: auto; }
.divine-card {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: clamp(28px, 7vw, 60px) clamp(18px, 5vw, 44px) 34px;
  border: 2px solid transparent;
  border-radius: 48px;
  background:
    linear-gradient(var(--divine-card, #0d1735), var(--divine-card, #0d1735)) padding-box,
    linear-gradient(145deg, #00c9f2, #3b7cff 55%, rgba(0, 222, 255, .15)) border-box;
  box-shadow: 0 0 36px rgba(0, 178, 255, .10), inset 0 0 40px rgba(15, 65, 130, .08);
}
.divine-avatar-ring {
  width: clamp(142px, 35vw, 220px);
  aspect-ratio: 1;
  padding: 8px;
  margin: 0 auto 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d7f5, #398bff 58%, #a46cff);
  box-shadow: 0 0 28px rgba(0, 201, 255, .26);
  box-sizing: border-box;
}
.divine-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 5px solid #101b39;
  border-radius: 50%;
  box-sizing: border-box;
  background: #182344;
}
.divine-avatar-placeholder {
  display: grid;
  place-items: center;
  color: #76dfff;
  font-size: 54px;
}
.divine-badge {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  padding: 12px 24px;
  border: 1px solid rgba(255, 190, 42, .65);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 180, 25, .13), rgba(255, 255, 255, .07));
  color: #ffc52e;
  font-size: clamp(12px, 2.6vw, 19px);
  font-weight: 800;
  letter-spacing: .20em;
}
.divine-badge > span:first-child { font-size: 20px; }
.divine-title {
  margin: 0 auto 22px;
  max-width: 100%;
  color: #fff;
  font-size: clamp(32px, 7vw, 54px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  background: linear-gradient(100deg, #fff 12%, #dceeff 43%, #00d5f5 70%, #5c9cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.divine-description {
  margin: 0 auto 48px;
  max-width: 460px;
  color: #99acd0;
  font-size: clamp(16px, 3.6vw, 24px);
  line-height: 1.5;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.divine-join-button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 112px;
  padding: 20px 24px;
  box-sizing: border-box;
  border-radius: 32px;
  background: linear-gradient(105deg, #079fe7, #05d4e9);
  color: white;
  text-decoration: none;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 194, 239, .25);
  transition: transform .18s ease, filter .18s ease;
}
.divine-join-button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.divine-telegram-icon {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #119bd5;
  background: white;
  font-size: 30px;
}
.divine-telegram-icon svg { width: 34px; height: 34px; }
.divine-button-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.divine-button-subtitle {
  font-size: clamp(10px, 2.4vw, 16px);
  letter-spacing: .18em;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.divine-button-copy strong {
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.divine-arrow { font-size: 52px; line-height: 1; font-weight: 300; }
.divine-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 30px auto 0;
  color: #87a9d0;
  font-size: clamp(12px, 2.7vw, 18px);
  line-height: 1.5;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.divine-footer > span:first-child { color: #00d7ad; font-size: 24px; }
.divine-editor-preview { min-height: 0; border-radius: 24px; padding: 12px; }
.divine-editor-preview .divine-card { border-radius: 28px; padding: 28px 16px; }
.divine-editor-preview .divine-avatar-ring { width: 112px; margin-bottom: 20px; padding: 5px; }
.divine-editor-preview .divine-badge { margin-bottom: 18px; padding: 8px 14px; letter-spacing: .12em; }
.divine-editor-preview .divine-title { font-size: clamp(24px, 5vw, 38px); }
.divine-editor-preview .divine-description { margin-bottom: 26px; font-size: 16px; }
.divine-editor-preview .divine-join-button { min-height: 80px; border-radius: 22px; padding: 14px; gap: 10px; }
.divine-editor-preview .divine-telegram-icon { flex-basis: 46px; width: 46px; height: 46px; font-size: 22px; }
.divine-editor-preview .divine-button-copy strong { font-size: 22px; }
.divine-editor-preview .divine-footer { margin-top: 20px; }
@media (max-width: 420px) {
  .divine-page { padding: 12px; }
  .divine-card { border-radius: 32px; padding: 30px 16px 26px; }
  .divine-join-button { gap: 10px; padding: 15px 13px; min-height: 88px; border-radius: 24px; }
  .divine-telegram-icon { flex-basis: 48px; width: 48px; height: 48px; }
  .divine-arrow { font-size: 38px; }
  .divine-badge { padding: 10px 15px; letter-spacing: .13em; }
}
