/* Generatorul avansat (/avansat).
   Fundalul continua pe intreaga pagina; antetul si subsolul raman cele ale site-ului.
   Tot ce este aici sta sub body.avansat-page sau sub clasele .av-*.
   Ordinea: 1. tokeni + fundal  2. titlu  3. carduri de sticla  4. campuri
            5. stiluri, audio, optiuni  6. butonul principal  7. rezultate + fereastra
            8. componente comune  9. animatia de intrare  9b. miscari la interactiune
            10. telefon */

/* ---------- 1. tokeni + fundal ---------- */

/* Titlurile folosesc un serif ingust, ca la Suno. Instrument Serif: SIL OFL 1.1
   (vezi /fonts/LICENSE-Instrument-Serif.txt). Doua subseturi, ca in fonts.css. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-latin-ext-400-normal.woff2?v=1) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-latin-400-normal.woff2?v=1) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body.avansat-page {
  --av-ink: #2f2219;
  --av-ink-soft: #6b5a51;
  --av-ink-faint: #9d918b;
  --av-green: #f56d18;
  --av-green-deep: #d75100;
  --av-green-ink: #884720;
  --av-green-line: #e06011;
  --av-field: rgba(255, 255, 255, 0.72);
  --av-panel-solid: #fefdfc;
  --av-line: rgba(136, 71, 32, 0.12);
  --av-line-strong: rgba(136, 71, 32, 0.22);
  --av-wash: rgba(136, 71, 32, 0.07);
  --av-wash-strong: rgba(136, 71, 32, 0.12);
  --av-focus: #f56d18;
  --av-free: #884720;
  --av-free-soft: rgba(245, 109, 24, 0.12);
  --av-error: #b42234;
  --av-error-soft: rgba(214, 45, 66, 0.08);
  --av-radius-panel: 24px;
  --av-font-title: "Instrument Serif", "DM Serif Display", Georgia, "Times New Roman", serif;
  --av-radius-field: 16px;
  --av-gradient: linear-gradient(110deg, #ef8748 0%, #e95901 52%, #bc4700 100%);
  /* Un singur fundal continuu, inclusiv in spatele antetului si subsolului.
     Se adapteaza la inaltimea continutului cand se deschid panourile. */
  background: #fffdfc url("/images/avansat-mint-background.webp") center top / 100% 100% no-repeat;
  color: var(--av-ink);
}

/* Referinta este luminoasa si curata, fara grila sau textura suprapusa. */
body.avansat-page::before {
  display: none;
}

body.avansat-page .page-shell {
  z-index: 1;
}

.avansat-page [hidden] {
  display: none !important;
}

.av-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.av-main {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 34px 0 72px;
}

/* Site-ul micsoreaza tot desktopul la 80% (zoom pe body), deci 880px apar ca ~700px. */
.av-stage {
  width: min(100%, 880px);
  min-width: 0;
}

/* ---------- 2. titlu ---------- */

.av-head {
  position: relative;
  margin: 0 0 34px;
  text-align: center;
}

.av-head-copy {
  min-width: 0;
  container-type: inline-size;
}

.av-eyebrow {
  margin: 0 0 14px;
  color: #a57553;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.av-back {
  z-index: 2;
  position: absolute;
  top: 34px;
  left: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 50%;
  color: var(--av-ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px var(--av-line), 0 8px 18px -12px rgba(108, 50, 15, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.2s ease;
}

.av-back:hover {
  background: #fff;
}

.av-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Doua randuri centrate, cu Inter la o grosime medie. */
.av-head h1 {
  max-width: none;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: min(4.5rem, 8.2cqi);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: #1a120e;
}

/* Fiecare rand are masca lui, ca titlul sa poata urca la intrare. */
.av-title-line {
  display: block;
  overflow: hidden;
  padding: 0.1em 0 0.06em;
  margin: -0.1em 0 -0.06em;
}

.av-title-line > span {
  display: block;
  white-space: nowrap;
}

.av-sub {
  max-width: 780px;
  margin: 12px auto 0;
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: #566970;
  text-wrap: balance;
}

/* ---------- 3. carduri de sticla ---------- */

.av-form {
  display: grid;
  /* minmax(0, 1fr): randul de sugestii se deruleaza in loc sa largeasca pagina. */
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

/* Sticla simpla: transparenta uniforma, blur si o muchie discreta. */
.av-panel {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--av-radius-panel);
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(136, 71, 32, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 32px -22px rgba(47, 34, 25, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Lumina care trece o data peste butonul principal la intrare. */
.av-create::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.75) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
}

.av-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.av-panel-lyrics .av-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  margin-bottom: 14px;
}

.av-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--av-ink);
}

.av-panel-icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--av-green-deep);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* comutator Auto / Scriu versurile si alegerea vocii */
.av-segment {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(136, 71, 32, 0.06);
  box-shadow: inset 0 1px 2px rgba(108, 50, 15, 0.08);
}

.av-segment button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--av-ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.av-segment button:hover {
  color: var(--av-ink);
}

.av-segment button[aria-checked="true"] {
  background: #fff;
  color: var(--av-ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(108, 50, 15, 0.14), 0 6px 14px -8px rgba(108, 50, 15, 0.35);
}

.av-segment button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.av-segment-wide {
  flex-wrap: wrap;
  justify-self: start;
}

/* Un singur indicator alb aluneca intre Auto si Scriu versurile. */
#av-mode { position: relative; transition: opacity 160ms ease; }
#av-mode[aria-hidden="true"] { opacity: 0; pointer-events: none; }
#av-mode button { position: relative; z-index: 1; }
#av-mode.has-thumb button[aria-checked="true"] { background: transparent; box-shadow: none; }
#av-mode .av-segment-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--thumb-w);
  height: var(--thumb-h);
  transform: translate(var(--thumb-x), var(--thumb-y));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(108, 50, 15, .14), 0 6px 14px -8px rgba(108, 50, 15, .35);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), width 260ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
#av-mode .av-segment-thumb.is-instant { transition: none; }

/* ---------- 4. campuri ---------- */

.av-field {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.av-field:focus-within {
  background: transparent;
  box-shadow: none;
}

.av-panel:focus-within {
  border-color: rgba(245, 109, 24, 0.35);
}

.av-field-lyrics {
  position: relative;
}

.av-field-lyrics.is-action-transition { overflow: clip; }
.av-field-lyrics > [data-action-ghost] { pointer-events: none; }

.av-field textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 15px 16px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--av-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: -0.005em;
  resize: vertical;
  outline: none;
}

.av-field-styles textarea {
  min-height: 166px;
  padding-bottom: 64px;
}

.av-style-writing { position: relative; }

.av-field-lyrics textarea {
  padding-bottom: 68px;
}

/* Textul este integrat direct in cardul de sticla, fara o suprafata interioara. */
.av-field textarea,
.av-field textarea:focus,
.av-field textarea:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
  transform: none;
}

.av-field textarea::placeholder,
.av-input::placeholder {
  color: var(--av-ink-faint);
  opacity: 1;
}

.av-field-lyrics textarea.is-invalid {
  border-radius: 14px;
  background: var(--av-error-soft);
  box-shadow: inset 0 0 0 2px var(--av-error);
}

.av-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.av-panel-foot .av-switch {
  margin: 0;
}

.av-count {
  flex: none;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--av-ink-faint);
  white-space: nowrap;
}

.av-count.is-over {
  color: var(--av-error);
}

.av-soft-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px 0 15px;
  border: 1px solid rgba(245, 109, 24, 0.18);
  border-radius: 999px;
  background: rgba(245, 109, 24, 0.09);
  color: var(--av-green-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.av-soft-button:hover {
  border-color: rgba(245, 109, 24, 0.32);
  background: rgba(245, 109, 24, 0.15);
}

.av-soft-button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.av-soft-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Vinilul mini (vezi vinyl-loader.css). */
.av-lyrics-spinner {
  display: none;
  flex: none;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--am-vinyl-mini-bg, #833906);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 10px rgba(241, 171, 127, 0.25);
  animation: av-spin 1.2s linear infinite;
}

.av-soft-button.is-busy {
  opacity: 1;
}

.av-soft-button.is-busy > svg {
  display: none;
}

.av-soft-button.is-busy > .av-lyrics-spinner {
  display: inline-block;
}

/* Flotant in coltul campului; spatiul rezervat in textarea protejeaza textul. */
.av-field-lyrics > .av-soft-button,
.av-style-writing > .av-soft-button {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 1;
  white-space: nowrap;
  border-color: #4a3f39;
  background: #2a2522;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(47, 34, 25, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.av-field-lyrics > .av-soft-button:hover {
  border-color: #5f5047;
  background: #38312d;
}

.av-field-lyrics > .av-lyrics-guide,
.av-style-writing > .av-styles-guide {
  border-color: #ebe4e0;
  background: #fff;
  color: var(--av-ink);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(47, 34, 25, 0.08);
}

.av-field-lyrics > .av-lyrics-guide:hover,
.av-style-writing > .av-styles-guide:hover {
  border-color: #cfbdb3;
  background: #fff;
}

.av-lyrics-guide svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.av-lyrics-guide:focus-visible { outline: 2px solid #a14402; outline-offset: 3px; }

/* comutator Instrumental */
.av-switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  color: var(--av-ink-soft);
  font-size: 0.9375rem;
  font-weight: 520;
  cursor: pointer;
  user-select: none;
}

.av-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.av-switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(136, 71, 32, 0.16);
  box-shadow: inset 0 1px 2px rgba(108, 50, 15, 0.12);
  transition: background 0.2s ease;
}

.av-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(108, 50, 15, 0.3);
  transition: transform 0.2s ease;
}

.av-switch input:checked + .av-switch-track {
  background: var(--av-gradient);
}

.av-switch input:checked + .av-switch-track .av-switch-thumb {
  transform: translateX(20px);
}

.av-switch input:checked ~ .av-switch-label {
  color: var(--av-ink);
}

.av-switch input:focus-visible + .av-switch-track {
  outline: 2px solid var(--av-focus);
  outline-offset: 3px;
}

/* ---------- 5. panouri pliabile: stiluri, audio, optiuni ---------- */

.av-collapsible {
  padding: 0;
}

.av-collapse-heading {
  margin: 0;
  font: inherit;
}

.av-collapse {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 0 14px 0 18px;
  border: 0;
  border-radius: var(--av-radius-panel);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.av-collapse-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--av-ink-faint);
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
}

.av-panel.is-disabled .av-collapse {
  opacity: .45;
}

.av-collapse:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.av-chevron {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(136, 71, 32, 0.07);
  transition: background-color 0.18s ease;
}

.av-chevron svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--av-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.av-collapse:hover .av-chevron {
  background: rgba(136, 71, 32, 0.13);
}

.av-collapse[aria-expanded="true"] .av-chevron svg {
  transform: rotate(90deg);
}

.av-collapse-body {
  padding: 0 18px 18px;
}

.av-soon {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--av-wash);
  color: var(--av-ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

/* sugestii de stil */
.av-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 12px 12px;
}

.av-icon-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--av-green-ink);
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.4s ease;
}

.av-icon-button:hover {
  background: var(--av-wash);
}

.av-icon-button.is-spinning {
  transform: rotate(180deg);
}

.av-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.av-chips {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
}

.av-chips::-webkit-scrollbar {
  display: none;
}

.av-chips-wrap {
  flex-wrap: wrap;
  overflow: visible;
  mask-image: none;
  -webkit-mask-image: none;
}

.av-chip {
  flex: none;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--av-line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--av-ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.av-chip:hover {
  border-color: rgba(245, 109, 24, 0.5);
  color: var(--av-ink);
}

.av-chip[aria-pressed="true"],
.av-chip[aria-checked="true"] {
  border-color: transparent;
  background: var(--av-gradient);
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(215, 81, 0, 0.8);
}

.av-chip[aria-pressed="true"]::before {
  content: "✓";
  margin-right: 6px;
  font-size: 0.8em;
}

/* Sugestii in asteptare, cat timp se incarca stilurile. */
.av-chip-skeleton {
  flex: none;
  width: var(--w, 86px);
  height: 38px;
  border-radius: 999px;
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.9) 50%, transparent 70%) -150% 0 / 200% 100% no-repeat,
    rgba(136, 71, 32, 0.08);
  animation: av-shimmer 1.3s ease-in-out infinite;
}

@keyframes av-shimmer {
  to {
    background-position: 250% 0, 0 0;
  }
}

.av-hint {
  margin: 12px 2px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--av-ink-soft);
}

.av-hint strong {
  color: var(--av-green-ink);
  font-weight: 650;
}

.av-style-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #eee0d7;
  border-radius: 12px;
  background: #fbf6f3;
  color: #974715;
}

.av-style-alert svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* audio */
.av-audio-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.av-audio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid var(--av-line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--av-ink);
  font-size: 1rem;
  font-weight: 600;
}

.av-audio-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.av-audio-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* mai multe optiuni */
.av-option {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid var(--av-line);
}

.av-option:first-child {
  padding-top: 2px;
  border-top: 0;
}

.av-option-label {
  font-size: 0.875rem;
  font-weight: 620;
  color: var(--av-ink);
}

.av-input,
.av-select select {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-field);
  color: var(--av-ink);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.av-input:focus,
.av-select select:focus {
  border-color: rgba(245, 109, 24, 0.6);
  box-shadow: 0 0 0 4px rgba(245, 109, 24, 0.13);
}

.av-select {
  position: relative;
}

.av-select select {
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

.av-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--av-ink-soft);
  border-bottom: 2px solid var(--av-ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Cautarea se extinde peste selector, ca pl-mobile-library-search din biblioteca. */
.av-language-control {
  position: relative;
  display: flex;
  gap: 8px;
}

.av-language-control > .av-select {
  flex: 1;
  min-width: 0;
}

.av-language-search-open,
.av-language-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 7px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #f2e9e3;
  border-radius: 999px;
  background: #fff;
  color: #a14402;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.av-language-picker svg {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.av-language-search {
  position: absolute;
  z-index: 2;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 44px;
  height: 48px;
  padding: 0 6px 0 12px;
  overflow: hidden;
  border: 1px solid #eee2da;
  border-radius: 999px;
  background: linear-gradient(110deg, #fff, #fbf7f4);
  color: #a14402;
  opacity: 0;
  pointer-events: none;
  transition: width 260ms cubic-bezier(.2,.8,.2,1), opacity 160ms ease;
}

.av-language-picker.is-search-open .av-language-search {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
}

.av-language-picker.is-search-open .av-language-control > .av-select,
.av-language-picker.is-search-open .av-language-search-open {
  opacity: 0;
  pointer-events: none;
}

.av-language-search:focus-within {
  border-color: #cea48a;
}

.av-language-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 36px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #412919;
  font: inherit;
  font-size: 14px;
}

.av-language-search input:focus,
.av-language-search input:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
}

.av-language-search input::placeholder { color: #968a82; }
.av-language-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.av-language-search-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 6px;
  border: 0;
  background: transparent;
}

.av-language-search-open:hover,
.av-language-search-close:hover { background: #f7f0ec; }
.av-language-search-open:focus-visible,
.av-language-search-close:focus-visible { outline: 2px solid #a14402; outline-offset: 2px; }

.av-language-results-panel {
  margin-top: 8px;
  padding: 5px;
  border: 1px solid #eee2da;
  border-radius: 16px;
  background: #fffdfc;
}

.av-language-results {
  max-height: min(260px, 36dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.av-language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--av-ink);
  font-size: 14px;
  cursor: pointer;
}

.av-language-option:hover,
.av-language-option.is-active { background: #f7f0ec; }
.av-language-option[aria-selected="true"] { color: #a14402; font-weight: 600; }
.av-language-native { color: #968a82; font-size: 0.9em; text-align: right; }
.av-language-empty { margin: 0; padding: 12px; font-size: 14px; color: var(--av-ink-soft); }

.av-style-picker .av-chip-row { position: relative; min-width: 0; }
.av-style-picker .av-language-search-open { min-height: 38px; height: 38px; padding-inline: 12px; }
.av-style-picker .av-language-search { top: 4px; left: 10px; right: auto; height: 38px; }
.av-style-picker.is-search-open .av-language-search { width: calc(100% - 20px); }
.av-style-picker.is-search-open #av-shuffle,
.av-style-picker.is-search-open .av-chips { opacity: 0; pointer-events: none; }
.av-style-picker .av-language-results-panel { margin: 0 10px 10px; }
.av-style-picker .av-language-option { overflow-wrap: anywhere; }
.av-style-picker .av-language-option > :last-child { flex: none; font-size: 18px; }
.av-styles-count { display: block; padding: 0 12px; text-align: right; color: var(--av-ink-faint); font-size: 12px; }

/* ---------- 6. butonul principal ---------- */

.av-submit {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 6px;
}

.av-create {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  border-radius: 999px;
  background: var(--av-gradient);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow:
    0 20px 38px -18px rgba(215, 81, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 0 rgba(77, 55, 42, 0.18);
  transition: filter 0.2s ease, transform 0.12s ease;
}

/* granulat fin pe buton */
.av-create::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--av-grain);
  background-size: 140px 140px;
  opacity: 0.55;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.av-create:hover {
  filter: saturate(1.1) brightness(1.04);
}

.av-create:active {
  transform: translateY(1px);
}

.av-create:disabled {
  cursor: progress;
  filter: saturate(0.75);
}

.av-create:focus-visible,
.av-soft-button:focus-visible,
.av-segment button:focus-visible,
.av-collapse:focus-visible,
.av-chip:focus-visible,
.av-icon-button:focus-visible,
.av-back:focus-visible,
.av-ghost-button:focus-visible {
  outline: 2px solid var(--av-focus);
  outline-offset: 3px;
}

.av-create-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--am-vinyl-mini-bg, #833906);
  box-shadow: var(--am-vinyl-mini-shadow, none);
  animation: av-spin 1.2s linear infinite;
}

.av-create-symbol {
  flex: none;
  width: 30px;
  height: 26px;
  background: currentColor;
  mask: url("/aimuzica-symbol.svg") center / contain no-repeat;
  -webkit-mask: url("/aimuzica-symbol.svg") center / contain no-repeat;
}

.av-create.is-busy .av-create-symbol {
  display: none;
}

.av-create.is-busy .av-create-spinner {
  display: inline-block;
}

@keyframes av-spin {
  to {
    transform: rotate(360deg);
  }
}

.av-note {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--av-ink-soft);
  text-align: center;
}

.av-note a,
.av-hint a,
.av-error a,
.av-dialog a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.av-error {
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--av-error-soft);
  color: var(--av-error);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
}

.av-error-toast {
  position: fixed;
  z-index: 10020;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100% - 32px));
  padding: 12px 12px 12px 18px;
  border: 1px solid #efbfc5;
  border-radius: 16px;
  background: #fff5f6;
  box-shadow: 0 8px 28px rgba(78, 20, 28, 0.16);
  font-size: 15px;
  animation: av-error-arrive 180ms ease-out;
}

.av-error-toast p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.av-error-toast svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.av-error-icon { flex: none; }
.av-error-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.av-error-close:hover { background: var(--av-error-soft); }
.av-error-close:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }

@keyframes av-error-arrive {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 860px) {
  body.avansat-page.advanced-navigation-pending .site-footer { display: none; }
  body.avansat-page:not(.mobile-advanced-navigation-active) #mobile-dashboard-tabbar { display: none; }
  .av-error-toast {
    top: calc(12px + env(safe-area-inset-top, 0px));
    width: calc(100% - 24px);
    padding: 12px 10px 12px 16px;
  }
}

/* ---------- 7. rezultate (link trimis, credite) + fereastra pentru email ---------- */

.av-result {
  position: relative;
  padding: 30px 26px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--av-radius-panel);
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.2) 32%, rgba(255, 255, 255, 0) 48%),
    rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 1px rgba(136, 71, 32, 0.07), inset 0 1px 0 #fff, 0 30px 56px -34px rgba(108, 50, 15, 0.45);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  animation: av-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.av-result-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.av-result-card h2 {
  margin: 0;
  font-family: var(--av-font-title);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--av-ink);
}

.av-result-card p {
  max-width: 44ch;
  margin: 0;
  color: var(--av-ink-soft);
  line-height: 1.55;
}

.av-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.av-result-actions .av-create {
  width: auto;
  min-height: 54px;
  padding: 0 28px;
  font-size: 1rem;
  text-decoration: none;
}

.av-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid var(--av-line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--av-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.av-ghost-button:hover {
  background: #fff;
}

.av-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: var(--av-panel-solid);
  color: var(--av-ink);
  box-shadow: 0 0 0 1px rgba(136, 71, 32, 0.08), 0 40px 80px -30px rgba(67, 48, 36, 0.45);
}

.av-dialog[open] {
  animation: av-pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.av-dialog::backdrop {
  background: rgba(46, 33, 25, 0.32);
  backdrop-filter: blur(4px);
}

.av-dialog-form {
  display: grid;
  gap: 16px;
  padding: 28px 26px 24px;
}

.av-dialog h2 {
  margin: 0;
  font-family: var(--av-font-title);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.av-dialog-copy {
  margin: -6px 0 0;
  color: var(--av-ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.av-dialog-field {
  display: grid;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 620;
}

.av-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--av-ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}

.av-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--av-green-deep);
}

.av-dialog-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.av-create-compact {
  min-height: 54px;
  font-size: 1rem;
}

.av-dialog-login {
  margin: 0;
  color: var(--av-ink-soft);
  font-size: 0.875rem;
  text-align: center;
}

/* ---------- 8. componentele comune (versuri, link trimis) in stilul paginii ---------- */

body.avansat-page .lyrics-review-dialog {
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  color: var(--av-ink);
  background: var(--av-panel-solid);
  box-shadow: 0 0 0 1px rgba(136, 71, 32, 0.08), 0 40px 80px -30px rgba(67, 48, 36, 0.45);
}

body.avansat-page .lyrics-review-dialog::backdrop {
  background: rgba(46, 33, 25, 0.32);
}

body.avansat-page .lyrics-review-dialog h2 {
  font-family: var(--av-font-title);
  font-weight: 400;
  font-size: clamp(30px, 6vw, 38px);
  line-height: 1;
  letter-spacing: -0.01em;
}

body.avansat-page .lyrics-review-dialog p {
  color: var(--av-ink-soft);
}

body.avansat-page .lyrics-review-regenerate button,
body.avansat-page .lyrics-review-actions button {
  border-radius: 999px;
}

body.avansat-page .lyrics-review-actions [type="submit"],
body.avansat-page .lyrics-review-actions [data-adapt] {
  border-color: transparent;
  background: var(--av-gradient);
}

.av-result .account-handoff {
  padding-top: 6px;
}

.av-result .account-handoff h1 {
  font-family: var(--av-font-title);
  font-weight: 400;
  font-size: clamp(38px, 8vw, 52px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--av-ink);
}

.av-result .account-handoff .handoff-step-card h2 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.av-result .handoff-account-link {
  border-radius: 999px;
  background: var(--av-gradient);
  box-shadow: 0 20px 38px -18px rgba(215, 81, 0, 0.75);
}

/* ---------- 9. animatia de intrare ----------
   Clasa av-intro este pusa din <head>, doar la prima vizita din sesiune si doar daca
   sistemul nu cere miscare redusa. Totul este CSS: daca scriptul paginii intarzie,
   continutul apare oricum. La vizitele urmatoare (av-enter-soft) pagina doar apare lin. */

@keyframes av-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes av-line-up {
  from {
    transform: translateY(108%);
  }
  to {
    transform: none;
  }
}

@keyframes av-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes av-glare {
  0% {
    opacity: 1;
    background-position: 160% 0;
  }
  100% {
    opacity: 0;
    background-position: -60% 0;
  }
}

@keyframes av-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.av-intro .av-back {
  animation: av-fade 0.6s ease-out 0.1s both;
}

.av-intro .av-title-line > span {
  animation: av-line-up 0.85s cubic-bezier(0.2, 0.85, 0.2, 1) both;
  animation-delay: 0.12s;
}

.av-intro .av-sub {
  animation: av-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.42s both;
}

.av-intro .av-eyebrow {
  animation: av-fade 0.7s ease-out 0.1s both;
}

.av-intro .av-form > .av-panel {
  animation: av-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(0.52s + var(--p, 0) * 0.09s);
}

.av-intro .av-submit {
  animation: av-rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.92s both;
}

.av-intro .av-create::before {
  animation: av-glare 1.1s ease-in-out 1.55s both;
}

.av-enter-soft .av-stage {
  animation: av-fade 0.35s ease-out both;
}

/* ---------- 9b. miscari la interactiune ----------
   Butoane, panouri care se deschid, liste derulante si trecerile intre pasi.
   Curbe comune: iesire lina (0.2, 0.8, 0.2, 1) si un mic arc (0.34, 1.4, 0.64, 1).
   Pentru ridicari si apasari folosim proprietatile translate / scale, care se adauga
   peste transform, ca sa nu intre in conflict cu animatiile facute din JavaScript
   (indicatorul Auto/Scriu, schimbarea butoanelor din coltul versurilor, Instrumental).
   Cadrele au de regula doar „from”, ca la final elementul sa ramana exact cu stilul lui. */

@keyframes av-sheen {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

@keyframes av-rise-sm {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes av-fade-out {
  to { opacity: 0; }
}

@keyframes av-success-pop {
  from { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.06); }
}

@keyframes av-spark {
  from { opacity: 0; scale: 0.2; }
  60% { opacity: 1; scale: 1.2; }
}

@keyframes av-draw-y {
  from { transform: scaleY(0); }
}

@keyframes av-underline {
  from { transform: rotate(-3deg) scaleX(0); }
}

@keyframes av-plane-in {
  from { opacity: 0; transform: translate(-26px, 20px) rotate(-10deg) scale(0.9); }
}

@keyframes av-ring {
  from {
    box-shadow:
      inset 0 2px 3px rgba(249, 201, 175, 0.5),
      0 0 0 0 rgba(241, 192, 161, 0),
      0 0 0 0 rgba(250, 233, 222, 0),
      0 0 0 0 rgba(252, 241, 234, 0),
      0 0 0 0 rgba(253, 248, 245, 0);
  }
}

@keyframes av-float-in {
  from { opacity: 0; transform: translateY(-14px) rotate(-6deg) scale(0.92); }
  65% { opacity: 1; transform: translateY(3px) rotate(1deg) scale(1.01); }
}

@keyframes av-wiggle {
  0%, 100% { transform: none; }
  25% { transform: rotate(-12deg); }
  55% { transform: rotate(9deg); }
  80% { transform: rotate(-4deg); }
}

@keyframes av-dropdown {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

@keyframes av-leave {
  to { opacity: 0; transform: translateY(-8px) scale(0.99); filter: blur(4px); }
}

@keyframes av-lines-shimmer {
  to { background-position: 250% 0, 0 0, 0 26px, 0 52px, 0 78px; }
}

@keyframes av-toast-timer {
  to { transform: scaleX(0); }
}

/* Comutatorul de voce: acelasi indicator alb care aluneca, ca la Auto / Scriu versurile. */
#av-voices {
  position: relative;
  isolation: isolate;
}

#av-voices button {
  position: relative;
  z-index: 1;
}

#av-voices .av-segment-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--thumb-w, 0);
  height: var(--thumb-h, 0);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(108, 50, 15, 0.14), 0 6px 14px -8px rgba(108, 50, 15, 0.35);
  opacity: 0;
  transform: translate(var(--thumb-x, 0), var(--thumb-y, 0));
  transition:
    transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    width 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    height 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.2s ease;
  pointer-events: none;
}

#av-voices .av-segment-thumb.is-instant {
  transition: none;
}

#av-voices.has-thumb .av-segment-thumb {
  opacity: 1;
}

#av-voices.has-thumb button[aria-checked="true"] {
  background: transparent;
  box-shadow: none;
}

/* Apasarea: fiecare buton se strange putin sub deget. */
.av-segment button,
.av-chip,
.av-soft-button,
.av-ghost-button,
.av-language-search-open,
.av-language-search-close,
.av-icon-button,
.av-back,
.av-credit-buy,
.av-credit-return {
  transition-property: background-color, border-color, color, box-shadow, opacity, translate, scale, filter;
  transition-duration: 0.18s, 0.18s, 0.18s, 0.22s, 0.18s, 0.22s, 0.14s, 0.2s;
  transition-timing-function: ease, ease, ease, ease, ease, cubic-bezier(0.2, 0.8, 0.2, 1), cubic-bezier(0.2, 0.8, 0.2, 1), ease;
}

/* Butonul „alte sugestii” se intoarce cu un mic arc (clasa is-spinning vine din avansat.js). */
.av-icon-button {
  transition-property: background-color, scale, transform;
  transition-duration: 0.18s, 0.14s, 0.55s;
  transition-timing-function: ease, ease, cubic-bezier(0.34, 1.4, 0.64, 1);
}

.av-segment button:active:not(:disabled),
.av-chip:active,
.av-soft-button:active:not(:disabled),
.av-ghost-button:active,
.av-language-search-open:active,
.av-language-search-close:active,
.av-icon-button:active,
.av-credit-buy:active,
.av-credit-return:active {
  scale: 0.95;
}

/* Butonul principal: se ridica la trecere, se apasa la click, lumineaza cand lucreaza. */
.av-create {
  transition: filter 0.2s ease, transform 0.12s ease, translate 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.12s ease, box-shadow 0.25s ease;
}

.av-create:active:not(:disabled) {
  scale: 0.985;
}

.av-create-symbol {
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.av-create.is-busy .av-create-spinner,
.av-soft-button.is-busy > .av-lyrics-spinner {
  animation: av-spin 1.2s linear infinite, av-fade 0.24s ease-out;
}

.av-submit .av-create.is-busy::before {
  opacity: 0.55;
  animation: av-sheen 1.35s ease-in-out infinite;
}

.av-field-lyrics > .av-soft-button.is-busy {
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: av-sheen 1.2s linear infinite;
}

/* Cat timp scriem versurile: campul se estompeaza si arata randuri in asteptare. */
.av-field-lyrics textarea {
  transition: opacity 0.25s ease;
}

.av-field-lyrics::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 16px;
  right: 16px;
  height: 92px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent) -150% 0 / 45% 100% no-repeat,
    linear-gradient(rgba(136, 71, 32, 0.11), rgba(136, 71, 32, 0.11)) 0 0 / 92% 12px no-repeat,
    linear-gradient(rgba(136, 71, 32, 0.11), rgba(136, 71, 32, 0.11)) 0 26px / 76% 12px no-repeat,
    linear-gradient(rgba(136, 71, 32, 0.11), rgba(136, 71, 32, 0.11)) 0 52px / 84% 12px no-repeat,
    linear-gradient(rgba(136, 71, 32, 0.11), rgba(136, 71, 32, 0.11)) 0 78px / 52% 12px no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.av-field-lyrics.is-generating::after {
  opacity: 1;
  animation: av-lines-shimmer 1.3s ease-in-out infinite;
}

.av-field-lyrics.is-generating textarea {
  opacity: 0.12;
}

.av-count {
  transition: color 0.2s ease;
}

/* Panourile pliabile: sageata se roteste cu un mic arc, iar cardul deschis iese putin in fata. */
.av-panel {
  transition: border-color 0.25s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}

.av-panel.is-open {
  background-color: rgba(255, 255, 255, 0.66);
  box-shadow:
    0 0 0 1px rgba(136, 71, 32, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 22px 44px -26px rgba(47, 34, 25, 0.24);
}

.av-chevron {
  transition: background-color 0.2s ease, scale 0.16s ease;
}

.av-chevron svg {
  transition: transform 0.42s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.av-collapse[aria-expanded="true"] .av-chevron {
  background-color: rgba(245, 109, 24, 0.14);
}

.av-collapse:active:not(:disabled) .av-chevron {
  scale: 0.9;
}

.av-collapse-summary {
  transition: opacity 0.25s ease;
}

.av-collapse[aria-expanded="true"] .av-collapse-summary {
  opacity: 0.55;
}

/* Comutatorul Instrumental: bila aluneca cu un mic arc si lasa un halou la apasare. */
.av-switch-track {
  transition: background 0.25s ease, box-shadow 0.2s ease;
}

.av-switch-thumb {
  transition: transform 0.36s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease;
}

.av-switch:active .av-switch-thumb {
  box-shadow: 0 0 0 6px rgba(245, 109, 24, 0.12), 0 1px 3px rgba(108, 50, 15, 0.3);
}

/* Sugestia de stiluri amestecate apare cu iconita care „saluta”. */
.av-style-alert:not([hidden]) svg {
  transform-origin: 50% 80%;
  animation: av-wiggle 0.7s ease-in-out 0.18s both;
}

/* Listele derulante (limba, stiluri): panoul coboara, primele optiuni intra pe rand din JS. */
.av-language-results-panel:not([hidden]) {
  transform-origin: top center;
  animation: av-dropdown 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.av-language-option {
  transition: background-color 0.15s ease, color 0.15s ease;
}

.av-style-picker .av-language-option > :last-child {
  transition: color 0.15s ease;
}

/* Notificarea de eroare: bara de jos arata cat mai ramane pana se inchide singura. */
.av-error-toast.is-timed::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.2;
  transform-origin: left center;
  animation: av-toast-timer 5s linear forwards;
  pointer-events: none;
}

.av-error-toast .av-error-icon {
  animation: av-success-pop 0.42s cubic-bezier(0.34, 1.4, 0.64, 1) 0.06s both;
}

/* Ferestrele: fundalul se intuneca lin, continutul intra pe randuri. */
.av-dialog[open]::backdrop,
#av-credit-notice[open]::backdrop,
body.avansat-page .lyrics-review-dialog[open]::backdrop {
  animation: av-fade 0.28s ease-out both;
}

.av-dialog.is-closing::backdrop {
  animation: av-fade-out 0.18s ease-in forwards;
}

body.avansat-page .lyrics-review-dialog[open],
#av-credit-notice[open] {
  animation: av-pop 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#av-email-dialog[open] .av-email-music > span {
  animation:
    av-success-pop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) 0.06s both,
    av-ring 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.14s both;
}

#av-email-dialog[open] .av-email-plane {
  animation: av-plane-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s both;
}

#av-email-dialog[open] #av-email-form > :is(h2, .av-dialog-copy, .av-dialog-field, .av-check, .av-dialog-actions, .av-dialog-login) {
  animation: av-rise-sm 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#av-email-dialog[open] #av-email-form > h2 { animation-delay: 0.08s; }
#av-email-dialog[open] #av-email-form > .av-dialog-copy { animation-delay: 0.13s; }
#av-email-dialog[open] #av-email-form > .av-dialog-field { animation-delay: 0.18s; }
#av-email-dialog[open] #av-email-form > .av-check { animation-delay: 0.22s; }
#av-email-dialog[open] #av-email-form > .av-dialog-actions { animation-delay: 0.26s; }
#av-email-dialog[open] #av-email-form > .av-dialog-login { animation-delay: 0.3s; }

#av-email-dialog[open] h2::after {
  transform-origin: left center;
  animation: av-underline 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.32s both;
}

#av-email-dialog[open] .av-email-close {
  animation: av-fade 0.3s ease-out 0.2s both;
}

/* Cererea salvata fara credite (in pagina pe telefon, fereastra pe desktop). */
.av-credit-card > :not(.av-credit-wallet),
.av-credit-benefits > span {
  animation: av-rise-sm 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.av-credit-card > .av-credit-wallet {
  animation: av-float-in 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.04s both;
}

.av-credit-card > h2 { animation-delay: 0.08s; }
.av-credit-card > p { animation-delay: 0.12s; }
.av-credit-card > .av-credit-saved { animation-delay: 0.16s; }
.av-credit-card > .av-credit-buy { animation-delay: 0.2s; }
.av-credit-card > .av-credit-return { animation-delay: 0.24s; }
.av-credit-benefits > span:nth-child(1) { animation-delay: 0.28s; }
.av-credit-benefits > span:nth-child(2) { animation-delay: 0.32s; }
.av-credit-benefits > span:nth-child(3) { animation-delay: 0.36s; }

.av-credit-saved .av-credit-check {
  animation: av-success-pop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 0.26s both;
}

.av-credit-buy svg {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#av-credit-purchase-dialog[open] #account-sidebar {
  animation: av-fade 0.24s ease-out both;
}

#av-credit-purchase-dialog[open] #account-credit-purchase-card {
  animation: av-pop 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) 0.04s both;
}

/* Pasul urmator: rezultatul intra, apoi elementele lui apar pe rand (totul in sub 0.7s). */
.av-result-card > *,
.av-result .account-handoff > *,
.av-result .handoff-steps > li {
  animation: av-rise-sm 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.av-result-card > :nth-child(2),
.av-result .account-handoff > :nth-child(2) { animation-delay: 0.06s; }
.av-result-card > :nth-child(3),
.av-result .account-handoff > :nth-child(3) { animation-delay: 0.1s; }
.av-result .account-handoff > :nth-child(4) { animation-delay: 0.12s; }
.av-result .account-handoff > :nth-child(5) { animation-delay: 0.26s; }
.av-result .account-handoff > :nth-child(n + 6) { animation-delay: 0.3s; }
.av-result .handoff-steps > li:nth-child(1) { animation-delay: 0.14s; }
.av-result .handoff-steps > li:nth-child(2) { animation-delay: 0.19s; }
.av-result .handoff-steps > li:nth-child(3) { animation-delay: 0.24s; }

.av-result .handoff-steps > li:not(:last-child)::after {
  transform-origin: top center;
  animation: av-draw-y 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) 0.28s both;
}

.av-result .account-handoff > .handoff-success {
  animation: av-success-pop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) 0.02s both;
}

.av-result .handoff-success i {
  animation: av-spark 0.42s cubic-bezier(0.34, 1.4, 0.64, 1) 0.2s both;
}

.av-result .handoff-success i:nth-of-type(2) { animation-delay: 0.23s; }
.av-result .handoff-success i:nth-of-type(3) { animation-delay: 0.26s; }
.av-result .handoff-success i:nth-of-type(4) { animation-delay: 0.29s; }

.av-result .handoff-account-link svg {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Plecarea spre pagina de status sau spre plata: continutul se stinge lin. */
.av-leaving .av-stage {
  animation: av-leave 0.3s ease-in forwards;
}

/* Ridicarile la trecerea mouse-ului doar pe ecranele cu mouse (pe telefon ar ramane „agatate”). */
@media (hover: hover) {
  .av-create:hover:not(:disabled) {
    translate: 0 -2px;
    box-shadow:
      0 26px 46px -18px rgba(215, 81, 0, 0.85),
      inset 0 1px 0 rgba(255, 255, 255, 0.32),
      inset 0 -2px 0 rgba(77, 55, 42, 0.18);
  }

  .av-create:active:not(:disabled) {
    translate: 0 0;
  }

  .av-create:hover:not(:disabled) .av-create-symbol {
    transform: scale(1.12) rotate(-6deg);
  }

  .av-chip:hover,
  .av-ghost-button:hover,
  .av-credit-buy:hover {
    translate: 0 -1px;
  }

  .av-field-lyrics > .av-soft-button:hover:not(:disabled),
  .av-style-writing > .av-soft-button:hover {
    box-shadow: 0 9px 20px rgba(47, 34, 25, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .av-back svg {
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .av-back:hover svg {
    transform: translateX(-2px);
  }

  .av-credit-buy:hover svg,
  .av-result .handoff-account-link:hover svg {
    transform: translateX(3px);
  }
}

/* ---------- 10. telefon ---------- */

@media (max-width: 860px) {
  body.avansat-page {
    background-size: 140% 100%;
  }

  .av-main {
    padding: 14px 16px 56px;
  }

  .av-head {
    margin-bottom: 28px;
  }

  .av-eyebrow {
    padding: 0 40px;
    font-size: 0.625rem;
    letter-spacing: 0.24em;
    margin-bottom: 16px;
  }

  .av-back {
    top: -4px;
    width: 32px;
    height: 32px;
  }

  .av-head h1 {
    font-size: min(3.5rem, 9cqi);
  }

  .av-sub {
    margin-top: 8px;
    font-size: 1rem;
  }

  /* Proportiile formularului mobil din referinta Suno, pastrand paleta site-ului.
     Anuleaza padding-ul comun al formularelor si lasa 10px pana la margini. */
  .av-form {
    width: calc(100% + 12px);
    margin-inline: -6px;
    padding: 0;
    gap: 20px;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.4;
  }

  .av-panel {
    padding: 8px;
  }

  .av-panel-title {
    gap: 6px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .av-panel-icon {
    width: 16px;
    height: 16px;
  }

  .av-panel-lyrics .av-panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin-bottom: 8px;
    padding-inline: 8px;
  }

  .av-panel-lyrics .av-panel-title {
    font-size: clamp(13px, 4vw, 16px);
    white-space: nowrap;
  }

  .av-panel-lyrics .av-segment {
    width: auto;
    padding: 3px;
  }

  .av-panel-lyrics .av-segment button {
    min-height: 30px;
    padding-inline: 9px;
    font-size: clamp(12px, 3.6vw, 14px);
    font-weight: 400;
    white-space: nowrap;
  }

  .av-collapsible {
    padding: 0;
  }

  .av-collapse {
    min-height: 60px;
    gap: 8px;
    padding: 0 14px 0 18px;
  }

  .av-collapse-body {
    padding: 0 8px 12px;
  }

  .av-panel-head {
    flex-wrap: wrap;
  }

  .av-segment button {
    padding: 0 10px;
    font-size: 14px;
    font-weight: 400;
  }

  .av-field textarea {
    min-height: 112px;
    padding: 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: -0.015em;
  }

  .av-field-lyrics textarea {
    height: 184px;
    min-height: 184px;
    padding-bottom: 58px;
  }

  .av-field-lyrics:not(:has(> .av-soft-button:not([hidden]))) textarea {
    padding-bottom: 36px;
  }

  .av-field-styles textarea {
    height: 166px;
  }

  .av-count {
    font-size: 11px;
  }

  .av-panel-foot {
    margin: 8px 8px 0;
  }

  .av-soft-button {
    min-height: 34px;
    padding: 0 12px;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
  }

  .av-soft-button svg {
    width: 15px;
    height: 15px;
  }

  .av-switch {
    position: relative;
    display: flex;
    width: fit-content;
    gap: 8px;
    margin: 8px 8px 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
  }

  .av-switch input {
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .av-switch-label {
    font: inherit;
  }

  .av-switch-track {
    height: 28.8px;
  }

  .av-switch-thumb {
    width: 24.8px;
    height: 24.8px;
    top: 2px;
    left: 2px;
  }

  .av-switch input:checked + .av-switch-track .av-switch-thumb {
    transform: translateX(19.2px);
  }

  .av-chip {
    min-height: 32px;
    padding-inline: 12px;
    font-size: 13px;
    font-weight: 400;
  }

  .av-option-label {
    font-size: 14px;
    font-weight: 400;
  }

  #av-more-body .av-option-label {
    padding-inline: 16px;
  }

  .av-input,
  .av-select select {
    min-height: 42px;
    font-size: 14px;
  }

  .av-language-search-open {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .av-language-search-open > span { display: none; }
  .av-language-search { height: 42px; }

  .av-submit {
    margin-top: 0;
  }

  .av-create {
    min-height: 58px;
    font-size: 18px;
    font-weight: 400;
  }

  .av-create-symbol {
    width: 26px;
    height: 22px;
  }

  .av-collapse-summary {
    display: none;
  }

  .av-collapse-summary.av-collapse-badge {
    display: block;
    flex: none;
  }

  .av-collapse .av-panel-title {
    flex: 1;
  }

  .av-audio-button {
    min-height: 54px;
  }

  .av-result {
    padding: 24px 18px;
  }

}

@media (max-width: 380px) {
  .av-panel-lyrics .av-panel-head {
    padding-inline: 4px;
  }

  .av-panel-lyrics .av-segment button {
    padding-inline: 6px;
  }

  .av-field-lyrics > .av-soft-button {
    right: 8px;
    padding: 0 10px;
    gap: 5px;
    font-size: 0.8rem;
  }

  .av-panel-head {
    gap: 10px;
  }

  .av-segment-wide {
    width: 100%;
  }

  .av-segment-wide button {
    flex: 1;
  }
}

/* Modul instrumental pastreaza textul lizibil intr-un card cu circa 40% mai scund. */
.av-panel-lyrics.is-instrumental .av-field-lyrics textarea {
  height: 84px;
  min-height: 84px;
  padding-bottom: 12px;
}

@media (max-width: 860px) {
  .av-panel-lyrics.is-instrumental .av-field-lyrics textarea {
    height: 68px;
    min-height: 68px;
  }
  .av-back,
  .av-back:hover { border: 0; background: transparent; box-shadow: none; }
  .av-style-picker .av-language-search-open { width: 38px; padding: 0; }
  .av-style-picker .av-language-search input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .avansat-page *,
  .avansat-page *::before,
  .avansat-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }

  .av-create-spinner,
  .av-lyrics-spinner {
    animation-duration: 1.6s !important;
  }

  .av-chip-skeleton {
    animation: none !important;
  }
}

/* Miscare redusa: animatiile in bucla din 9b se opresc de tot, iar continutul nu se mai stinge. */
@media (prefers-reduced-motion: reduce) {
  .av-field-lyrics.is-generating::after,
  .av-submit .av-create.is-busy::before,
  .av-field-lyrics > .av-soft-button.is-busy,
  .av-leaving .av-stage {
    animation: none !important;
  }

  .av-error-toast.is-timed::after {
    display: none;
  }
}
@media (max-width: 860px) {
  body.avansat-page.mobile-advanced-navigation-active { --mobile-dashboard-scale: 1; }
  body.avansat-page.mobile-advanced-navigation-active .av-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.avansat-page.mobile-advanced-navigation-active .site-footer { display: none; }
}
