/* ==========================================================================
   analizy-magic.css — анимации виджета «Расшифровка анализов»:
   превью файла → «сканер» при обработке → раскрытие результата →
   форма e-mail / код. Подключается из analizy_widget.twig, лежит отдельно от
   service-landing.css, чтобы не пересекаться с правками дизайна лендинга.
   Всё завязано на префикс .am- и на .service-widget-analizy.
   ========================================================================== */

.service-widget-analizy {
	--am-blue: #0874f9;
	--am-violet: #7c5cff;
	--am-cyan: #22d3ee;
	--am-ink: #071537;
	--am-muted: #7180ac;
	--am-line: rgba(8, 116, 249, .14);
	--am-ease: cubic-bezier(.22, 1, .36, 1);
	--am-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@property --am-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- Карточка: плавное «перестроение» высоты ---------- */
.svc-widget-card.am-morph { overflow: hidden !important; transition: height .55s var(--am-ease); }
.svc-widget-card.am-busy { box-shadow: 0 0 0 1px rgba(8,116,249,.12), 0 24px 60px -18px rgba(8,116,249,.45), 0 0 80px -10px rgba(124,92,255,.35) !important; transition: box-shadow .6s ease; }

/* Форма «уходит на задний план», пока идёт обработка */
.service-widget-analizy .medical-upload.am-dim { filter: blur(7px) saturate(.8); transform: scale(.985); opacity: .55; pointer-events: none; transition: filter .5s var(--am-ease), transform .5s var(--am-ease), opacity .5s ease; }

/* ---------- Форма: превью файла, кнопка ---------- */
.service-widget-analizy .medical-upload__dropzone { transition: border-color .25s ease, background-color .25s ease, box-shadow .3s ease, transform .3s var(--am-ease); }
.service-widget-analizy .medical-upload__dropzone:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(8,116,249,.45); }
.service-widget-analizy .medical-upload__dropzone.dragover { border-color: var(--am-blue); background: rgba(8,116,249,.06); box-shadow: 0 0 0 5px rgba(8,116,249,.12), 0 18px 40px -14px rgba(8,116,249,.5); transform: scale(1.015); }
.service-widget-analizy .medical-upload__dropzone-icon { transition: transform .4s var(--am-spring); }
.service-widget-analizy .medical-upload__dropzone:hover .medical-upload__dropzone-icon { transform: translateY(-3px) scale(1.06); }
.service-widget-analizy .medical-upload__dropzone.has-file { border-style: solid; border-color: rgba(8,116,249,.35); }
.am-drop-thumb { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 16px; box-shadow: 0 10px 24px -8px rgba(8,21,55,.4), 0 0 0 3px #fff, 0 0 0 4px rgba(8,116,249,.25); animation: am-pop .55s var(--am-spring); }
@keyframes am-pop { from { opacity: 0; transform: scale(.4) rotate(-8deg); } to { opacity: 1; transform: none; } }

.service-widget-analizy .medical-upload__submit { position: relative; overflow: hidden; isolation: isolate; transition: transform .25s var(--am-ease), box-shadow .3s ease, filter .2s ease; }
.service-widget-analizy .medical-upload__submit::after { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-20deg); transition: left .7s var(--am-ease); }
.service-widget-analizy .medical-upload__submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 34px -10px rgba(8,116,249,.6); }
.service-widget-analizy .medical-upload__submit:hover:not(:disabled)::after { left: 120%; }
.service-widget-analizy .medical-upload__submit:active:not(:disabled) { transform: translateY(0) scale(.985); }
.service-widget-analizy .medical-upload__submit svg { transition: transform .3s var(--am-spring); }
.service-widget-analizy .medical-upload__submit:hover:not(:disabled) svg { transform: translateX(4px); }
.am-ripple { position: absolute; z-index: -1; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255,255,255,.55); animation: am-ripple .7s ease-out forwards; pointer-events: none; }
@keyframes am-ripple { to { transform: scale(40); opacity: 0; } }

/* ==========================================================================
   Экран обработки («сканер»)
   ========================================================================== */
.am-overlay { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 28px; border-radius: inherit; background: radial-gradient(120% 100% at 0% 0%, rgba(232,242,255,.96), rgba(255,255,255,.97) 55%), #fff; animation: am-overlay-in .45s var(--am-ease); overflow: hidden; }
.am-overlay.is-leaving { opacity: 0; transform: scale(1.02); transition: opacity .5s ease, transform .6s var(--am-ease); pointer-events: none; }
@keyframes am-overlay-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* бегущая градиентная рамка по периметру карточки */
.am-ring { position: absolute; inset: 0; padding: 2px; border-radius: inherit; background: conic-gradient(from var(--am-a), var(--am-blue), var(--am-violet), var(--am-cyan), var(--am-blue)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: am-spin 2.6s linear infinite; pointer-events: none; }
@keyframes am-spin { to { --am-a: 360deg; } }
/* фон-«аврора» */
.am-overlay::before, .am-overlay::after { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; animation: am-float 7s ease-in-out infinite alternate; }
.am-overlay::before { left: -120px; top: -140px; background: rgba(8,116,249,.35); }
.am-overlay::after { right: -120px; bottom: -160px; background: rgba(124,92,255,.32); animation-delay: -3s; }
@keyframes am-float { to { transform: translate(40px, 30px) scale(1.15); } }

.am-stage { position: relative; z-index: 1; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 34px; width: 100%; max-width: 640px; }
.am-scan { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #eaf2ff; box-shadow: 0 30px 50px -24px rgba(8,21,55,.55), 0 0 0 1px rgba(8,116,249,.2); transform: rotate(-2.5deg); animation: am-scan-in .8s var(--am-spring) both; }
@keyframes am-scan-in { from { opacity: 0; transform: translateY(24px) rotate(-8deg) scale(.85); } to { opacity: 1; transform: rotate(-2.5deg); } }
.am-scan img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.am-scan::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8,116,249,.0), rgba(8,116,249,.18)), repeating-linear-gradient(0deg, rgba(8,116,249,.08) 0 1px, transparent 1px 7px); mix-blend-mode: multiply; }
.am-scan__laser { position: absolute; left: -6%; right: -6%; z-index: 2; height: 46px; top: -46px; background: linear-gradient(180deg, transparent, rgba(34,211,238,.28) 70%, rgba(8,116,249,.55)); border-bottom: 2px solid #22d3ee; box-shadow: 0 6px 26px rgba(34,211,238,.9); animation: am-laser 2.2s cubic-bezier(.45,.05,.55,.95) infinite alternate; }
@keyframes am-laser { to { top: 100%; } }
.am-scan__c { position: absolute; z-index: 3; width: 20px; height: 20px; border: 0 solid #fff; filter: drop-shadow(0 1px 3px rgba(8,21,55,.5)); }
.am-scan__c--tl { top: 9px; left: 9px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 7px; }
.am-scan__c--tr { top: 9px; right: 9px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 7px; }
.am-scan__c--bl { bottom: 9px; left: 9px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 7px; }
.am-scan__c--br { bottom: 9px; right: 9px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 7px; }

.am-stage__title { margin: 0 0 4px; color: var(--am-ink); font: 800 26px/1.1 Inter, sans-serif; letter-spacing: -.045em; }
.am-stage__title span { color: var(--am-blue); }
.am-stage__hint { margin: 0 0 20px; color: var(--am-muted); font: 400 14px/1.4 Inter, sans-serif; }

.am-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 4px; }
.am-steps li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; color: #9aa6c8; font: 500 15px/1.25 Inter, sans-serif; transition: color .3s ease, background-color .3s ease, transform .4s var(--am-ease); }
.am-steps__ico { position: relative; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d5def3; transition: border-color .3s ease, background-color .3s ease, transform .4s var(--am-spring); }
.am-steps li.is-active { color: var(--am-ink); background: rgba(8,116,249,.07); transform: translateX(4px); }
.am-steps li.is-active .am-steps__ico { border-color: rgba(8,116,249,.2); border-top-color: var(--am-blue); border-right-color: var(--am-violet); animation: am-rot .8s linear infinite; }
@keyframes am-rot { to { transform: rotate(360deg); } }
.am-steps li.is-done { color: #55648f; }
.am-steps li.is-done .am-steps__ico { border-color: transparent; background: linear-gradient(135deg, #2bd17e, #0aa35e); transform: scale(1.05); }
.am-steps li.is-done .am-steps__ico::after { content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(40deg); animation: am-tick .35s ease both; }
@keyframes am-tick { from { opacity: 0; transform: rotate(40deg) scale(.3); } to { opacity: 1; transform: rotate(40deg) scale(1); } }

.am-progress { height: 6px; border-radius: 99px; background: rgba(8,116,249,.12); overflow: hidden; }
.am-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--am-blue), var(--am-violet), var(--am-cyan)); background-size: 200% 100%; animation: am-fill 12s cubic-bezier(.3,.6,.4,1) forwards, am-shine 1.4s linear infinite; }
.am-progress.is-full i { width: 100% !important; animation: am-shine 1.4s linear infinite; transition: width .4s var(--am-ease); }
@keyframes am-fill { to { width: 92%; } }
@keyframes am-shine { to { background-position: -200% 0; } }

/* ==========================================================================
   Экран результата
   ========================================================================== */
.am-results { text-align: left; }
.am-results.am-enter > * { animation: am-rise .7s var(--am-ease) both; }
.am-results.am-enter > *:nth-child(2) { animation-delay: .12s; }
.am-results.am-enter > *:nth-child(3) { animation-delay: .24s; }
.am-results.am-enter > *:nth-child(4) { animation-delay: .34s; }
@keyframes am-rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.am-results__head { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.am-results__titles { min-width: 0; flex: 1; }
.am-results__title { margin: 0; color: var(--am-ink); font: 800 26px/1.1 Inter, sans-serif; letter-spacing: -.045em; }
.am-results__meta { margin: 5px 0 0; color: var(--am-muted); font: 500 14px/1.3 Inter, sans-serif; }
.am-results__thumb { flex: 0 0 auto; width: 54px; height: 68px; object-fit: cover; border-radius: 10px; transform: rotate(3deg); box-shadow: 0 10px 22px -8px rgba(8,21,55,.45), 0 0 0 3px #fff, 0 0 0 4px rgba(8,116,249,.2); }

.am-check { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; }
.am-check svg { width: 100%; height: 100%; overflow: visible; }
.am-check__ring { stroke: #19c37d; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 145; stroke-dashoffset: 145; fill: rgba(25,195,125,.1); }
.am-check__tick { stroke: #19c37d; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 38; stroke-dashoffset: 38; }
.am-check--sm { width: 44px; height: 44px; }
.am-play .am-check__ring { animation: am-draw .7s .15s var(--am-ease) forwards; }
.am-play .am-check__tick { animation: am-draw .45s .7s var(--am-ease) forwards; }
@keyframes am-draw { to { stroke-dashoffset: 0; } }
.am-check i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--c, #19c37d); opacity: 0; }
.am-check i:nth-of-type(1) { --c: #0874f9; --x: -38px; --y: -30px; }
.am-check i:nth-of-type(2) { --c: #7c5cff; --x: 38px; --y: -32px; }
.am-check i:nth-of-type(3) { --c: #22d3ee; --x: 44px; --y: 10px; }
.am-check i:nth-of-type(4) { --c: #ffb020; --x: -44px; --y: 12px; }
.am-check i:nth-of-type(5) { --c: #19c37d; --x: 8px; --y: 42px; }
.am-check i:nth-of-type(6) { --c: #ff5c7a; --x: -10px; --y: -44px; }
.am-play .am-check i { animation: am-burst .9s .75s ease-out forwards; }
@keyframes am-burst { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); } }

/* тело расшифровки: карточка с построчным проявлением */
.service-widget-analizy .decryption-result-section.am-res-body { position: relative; padding: 6px; border-radius: 20px; background: linear-gradient(180deg, #f5f9ff, #fff); box-shadow: inset 0 0 0 1px rgba(8,116,249,.1); }
.service-widget-analizy .decryption-result-section.am-res-body::before { display: none; }
.am-res-text { display: grid; gap: 4px; max-height: 420px; overflow: auto; padding: 10px; scrollbar-width: thin; }
.am-line { position: relative; display: block; padding: 11px 14px 11px 40px; border-radius: 14px; color: #23315c; font: 400 15px/1.6 Inter, sans-serif; opacity: 0; transform: translateY(12px); filter: blur(5px); animation: am-line-in .6s var(--am-ease) forwards; animation-delay: calc(var(--i, 0) * 70ms + .15s); transition: background-color .2s ease; }
.am-line:hover { background: rgba(8,116,249,.05); }
@keyframes am-line-in { to { opacity: 1; transform: none; filter: none; } }
.am-line::before { content: ''; position: absolute; left: 15px; top: 19px; width: 10px; height: 10px; border-radius: 50%; background: #b9c6e6; box-shadow: 0 0 0 4px rgba(185,198,230,.25); }
.am-line[data-tone="ok"]::before { background: #19c37d; box-shadow: 0 0 0 4px rgba(25,195,125,.18); }
.am-line[data-tone="high"]::before { background: #ff8a1f; box-shadow: 0 0 0 4px rgba(255,138,31,.2); }
.am-line[data-tone="low"]::before { background: #0874f9; box-shadow: 0 0 0 4px rgba(8,116,249,.18); }
.am-line--h { margin-top: 6px; padding-top: 8px; padding-bottom: 4px; color: var(--am-ink); font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.am-line--h::before { display: none; }
.am-line--h { padding-left: 14px; }
.am-line strong { color: var(--am-ink); font-weight: 700; }
.am-num { display: inline-block; padding: 0 7px; margin: 0 1px; border-radius: 8px; background: rgba(8,116,249,.09); color: #0b4fb8; font-weight: 600; white-space: nowrap; }
.am-line[data-tone="ok"] .am-num { background: rgba(25,195,125,.13); color: #0a7a4a; }
.am-line[data-tone="high"] .am-num { background: rgba(255,138,31,.15); color: #b35800; }
.am-line--note { margin-top: 6px; padding: 12px 16px 12px 44px; background: #fff8e6; color: #8a5a00; font-size: 13.5px; }
.am-line--note::before { background: #ffb020; box-shadow: 0 0 0 4px rgba(255,176,32,.22); }

/* закрытая часть для гостя (тизер) */
.am-locked { position: relative; display: grid; gap: 10px; margin: 6px 10px 12px; padding: 18px 16px; border-radius: 16px; overflow: hidden; }
.am-locked[hidden] { display: none; }
.am-locked__bar { display: block; height: 12px; border-radius: 8px; background: linear-gradient(90deg, #dfe8fb 25%, #eef3ff 45%, #dfe8fb 65%); background-size: 200% 100%; animation: am-shimmer 1.6s linear infinite; filter: blur(2.5px); }
.am-locked__bar:nth-child(2) { width: 88%; } .am-locked__bar:nth-child(3) { width: 94%; } .am-locked__bar:nth-child(4) { width: 62%; }
@keyframes am-shimmer { to { background-position: -200% 0; } }
.am-locked__veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--am-blue); font: 600 14px/1 Inter, sans-serif; background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.75)); }
.am-locked__veil svg { padding: 9px; box-sizing: content-box; border-radius: 12px; background: #fff; box-shadow: 0 8px 20px -6px rgba(8,116,249,.4); animation: am-lock 2.4s ease-in-out infinite; }
@keyframes am-lock { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }

.service-widget-analizy #newAnalysisBtn { position: relative; margin-top: 16px; padding: 8px 2px; }
.service-widget-analizy #newAnalysisBtn::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 3px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--am-ease); }
.service-widget-analizy #newAnalysisBtn:hover::after { transform: scaleX(1); }

/* Фиксированная высота (десктоп): две колонки, внутренняя прокрутка */
.am-results.am-fixed { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 16px; overflow: hidden; }
.am-results.am-fixed.am-single { grid-template-columns: minmax(0, 1fr); }
.am-fixed .am-results__head { grid-column: 1; grid-row: 1; margin-bottom: 10px; }
.am-fixed .am-res-body { grid-column: 1; grid-row: 2; min-height: 0; overflow: auto; }
.am-fixed .am-res-text { max-height: none; overflow: visible; }
.am-fixed #newAnalysisBtn { grid-column: 1; grid-row: 3; justify-self: start; margin-top: 8px; }
.am-fixed .service-auth-wall.am-auth { grid-column: 2; grid-row: 1 / 4; align-self: stretch; display: flex; flex-direction: column; justify-content: center; margin-top: 0; padding: 18px; overflow: auto; }
.am-fixed .am-auth__head { margin-bottom: 10px; }
.am-fixed .am-auth__icon { width: 38px; height: 38px; border-radius: 12px; }
.service-widget-analizy .am-fixed .am-auth .am-auth__title { font-size: 15px; }
.am-fixed #quick-register-step-1.is-active { grid-template-columns: 1fr; }
.am-fixed .am-step { gap: 10px; }
.am-fixed .am-field input { height: 48px; }
.am-fixed .am-btn { min-height: 46px; }
.am-fixed .am-otp { gap: 6px; }
.service-widget-analizy .am-fixed .am-otp__cell { height: 42px; font-size: 21px; border-radius: 12px; }
.am-fixed .am-results__title { font-size: 19px; }
.am-fixed .am-results__meta { font-size: 12.5px; }
.am-fixed .am-auth__icon { display: none; }
.am-fixed .am-sent { font-size: 12.5px; line-height: 1.35; }
.am-fixed .am-resend { font-size: 12px; }
.am-fixed .service-auth-wall.am-auth { padding: 14px; }
.am-fixed .am-msg:not(:empty) { padding: 6px 10px; margin-top: 6px; }
.am-fixed .am-check { width: 42px; height: 42px; }
.am-fixed .am-results__head { gap: 12px; }
.am-fixed .am-results__thumb { width: 44px; height: 56px; }
.am-fixed .am-line { padding-top: 8px; padding-bottom: 8px; font-size: 14.5px; }
.am-fixed .am-line::before { top: 16px; }
.am-fixed .am-locked { margin: 4px 8px 8px; padding: 12px; }

/* ==========================================================================
   Блок e-mail → код
   ========================================================================== */
.service-widget-analizy .service-auth-wall.am-auth { position: relative; margin-top: 16px; padding: 22px; border-radius: 22px; overflow: hidden; border: 1px solid rgba(8,116,249,.14); background: radial-gradient(120% 140% at 100% 0%, rgba(124,92,255,.10), transparent 55%), radial-gradient(120% 140% at 0% 100%, rgba(8,116,249,.10), transparent 55%), rgba(255,255,255,.92); box-shadow: 0 24px 50px -28px rgba(8,116,249,.5); }
.am-auth.am-auth--in { animation: am-auth-in .8s var(--am-spring) both; }
@keyframes am-auth-in { from { opacity: 0; transform: translateY(34px) scale(.96); } to { opacity: 1; transform: none; } }
.am-auth__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.am-auth__icon { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--am-blue), var(--am-violet)); box-shadow: 0 10px 22px -8px rgba(8,116,249,.7); }
.service-widget-analizy .am-auth .am-auth__title { margin: 0; color: var(--am-ink); font: 700 17px/1.3 Inter, sans-serif; letter-spacing: -.02em; }

.am-step[hidden], .am-success[hidden] { display: none; }
.am-step { display: grid; gap: 12px; }
.am-step.is-active { animation: am-step-in .5s var(--am-ease) both; }
.am-step.is-leaving { animation: am-step-out .25s ease forwards; }
@keyframes am-step-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes am-step-out { to { opacity: 0; transform: translateX(-26px); } }
#quick-register-step-1.is-active { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
@media (max-width: 560px) { #quick-register-step-1.is-active { grid-template-columns: 1fr; } }

/* плавающая подпись */
.am-field { position: relative; display: block; }
.service-widget-analizy .am-field input { width: 100%; height: 56px; padding: 22px 16px 6px; border: 1.5px solid #dbe5fa; border-radius: 16px; outline: 0; background: #fff; color: var(--am-ink); font: 500 16px/1 Inter, sans-serif; box-shadow: none; transition: border-color .2s ease, box-shadow .25s ease; }
.service-widget-analizy .am-field input:focus { border-color: var(--am-blue); box-shadow: 0 0 0 4px rgba(8,116,249,.14), 0 10px 24px -14px rgba(8,116,249,.6); }
.am-field__label { position: absolute; left: 17px; top: 18px; color: #8a97bd; font: 500 16px/1 Inter, sans-serif; pointer-events: none; transform-origin: left top; transition: transform .22s var(--am-ease), color .2s ease; }
.am-field input:focus + .am-field__label, .am-field input:not(:placeholder-shown) + .am-field__label { transform: translateY(-11px) scale(.76); color: var(--am-blue); }
.am-field.is-error input { border-color: #ff5c7a; box-shadow: 0 0 0 4px rgba(255,92,122,.14); animation: am-shake .45s; }
@keyframes am-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* кнопки форм */
.am-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 26px; border: 0; border-radius: 16px; overflow: hidden; isolation: isolate; color: #fff; background: linear-gradient(100deg, var(--am-blue), var(--am-violet)); background-size: 160% 100%; font: 600 16px/1 Inter, sans-serif; cursor: pointer; box-shadow: 0 16px 30px -12px rgba(8,116,249,.65); transition: transform .25s var(--am-ease), box-shadow .3s ease, background-position .5s ease; }
.am-btn:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 20px 36px -12px rgba(8,116,249,.75); }
.am-btn:active { transform: scale(.98); }
.am-btn--success { background-image: linear-gradient(100deg, #10b36e, #0a8fd8); box-shadow: 0 16px 30px -12px rgba(16,179,110,.6); }
.am-btn__spin { display: none; width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: am-rot .7s linear infinite; }
.am-btn.is-loading { pointer-events: none; }
.am-btn.is-loading .am-btn__label { display: none; }
.am-btn.is-loading .am-btn__spin { display: block; }

/* ячейки кода */
.am-sent { margin: 0; color: var(--am-muted); font: 400 14px/1.45 Inter, sans-serif; }
.am-sent b { color: var(--am-ink); font-weight: 600; word-break: break-all; }
.am-sent a { margin-left: 6px; color: var(--am-blue); font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; }
.am-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.service-widget-analizy .am-otp__cell { width: 100%; height: 60px; padding: 0; border: 1.5px solid #dbe5fa; border-radius: 16px; outline: 0; background: #fff; color: var(--am-ink); text-align: center; font: 700 26px/1 Inter, sans-serif; caret-color: var(--am-blue); box-shadow: none; transition: border-color .2s ease, box-shadow .25s ease, transform .3s var(--am-spring), background-color .2s ease; animation: am-cell-in .55s var(--am-spring) both; }
.am-otp__cell:nth-child(2) { animation-delay: .05s; } .am-otp__cell:nth-child(3) { animation-delay: .1s; } .am-otp__cell:nth-child(4) { animation-delay: .15s; } .am-otp__cell:nth-child(5) { animation-delay: .2s; } .am-otp__cell:nth-child(6) { animation-delay: .25s; }
@keyframes am-cell-in { from { opacity: 0; transform: translateY(16px) scale(.8); } to { opacity: 1; transform: none; } }
.service-widget-analizy .am-otp__cell:focus { border-color: var(--am-blue); box-shadow: 0 0 0 4px rgba(8,116,249,.15); transform: translateY(-3px); }
.am-otp__cell.is-filled { border-color: rgba(8,116,249,.5); background: #f3f8ff; }
.am-otp.is-error .am-otp__cell { border-color: #ff5c7a; background: #fff5f7; }
.am-otp.is-error { animation: am-shake .45s; }
.am-otp.is-ok .am-otp__cell { border-color: #19c37d; background: #effcf6; color: #0a7a4a; }
.am-resend { margin: 0; text-align: center; color: var(--am-muted); font: 400 13px/1.3 Inter, sans-serif; }
.am-resend a { color: var(--am-blue); font-weight: 600; text-decoration: none; }
.am-resend a.is-disabled { color: #a8b3d1; pointer-events: none; }

.am-success { display: flex; align-items: center; gap: 14px; padding: 6px 2px; color: var(--am-ink); font: 600 15px/1.35 Inter, sans-serif; animation: am-rise .5s var(--am-ease) both; }
.am-success p { margin: 0; }
.am-success .am-check__ring { animation: am-draw .6s .05s var(--am-ease) forwards; }
.am-success .am-check__tick { animation: am-draw .4s .5s var(--am-ease) forwards; }

.am-msg { min-height: 0; margin-top: 10px; color: #d63355; font: 500 13.5px/1.4 Inter, sans-serif; }
.am-msg:empty { display: none; }
.am-msg:not(:empty) { padding: 10px 14px; border-radius: 12px; background: #fff1f4; animation: am-rise .35s var(--am-ease) both; }
.am-msg.is-info { color: #0a6a9a; background: #eaf7ff; }

/* ---------- Мобильные ---------- */
@media (max-width: 640px) {
	.am-overlay { padding: 20px 16px; }
	.am-stage { grid-template-columns: 1fr; justify-items: center; gap: 22px; text-align: center; }
	.am-scan { width: 128px; }
	.am-stage__title { font-size: 21px; }
	.am-steps { justify-items: stretch; text-align: left; }
	.am-steps li { font-size: 14px; }
	.am-stage__side { width: 100%; }
	.am-results__title { font-size: 21px; }
	.am-check { width: 46px; height: 46px; }
	.am-res-text { max-height: none; }
	.am-otp { gap: 7px; }
	.service-widget-analizy .am-otp__cell { height: 52px; font-size: 22px; border-radius: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.am-overlay, .am-overlay::before, .am-overlay::after, .am-ring, .am-scan, .am-scan__laser, .am-steps__ico, .am-progress i, .am-line, .am-locked__bar, .am-locked__veil svg,
	.am-results.am-enter > *, .am-auth.am-auth--in, .am-step.is-active, .am-otp__cell, .am-drop-thumb, .am-check i { animation: none !important; }
	.am-line { opacity: 1; transform: none; filter: none; }
	.am-check__ring, .am-check__tick { stroke-dashoffset: 0; }
	.svc-widget-card.am-morph { transition: none; }
}

/* Сброс унаследованных стилей .results-main-container (отступы/рамка/фон из старого CSS):
   из-за них карточка результата была выше формы и выглядела «рамкой в рамке». */
.service-widget-analizy .results-main-container.am-results { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* Фиксированная высота, шаг «код»: заголовок блока уже не нужен — экономим место */
.am-fixed .am-auth:has(#quick-register-step-2.is-active) .am-auth__head { display: none; }
.am-fixed .am-auth:has(#quick-register-step-2.is-active) { justify-content: flex-start; }

/* Старый CSS .results-main-container рисует тень и скругление — перебиваем жёстко. */
.service-widget-analizy .results-main-container.am-results { margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; }
/* overflow:hidden в фиксированном режиме обрезал тени правого блока и подсветку полей — оставляем небольшой запас */
.am-results.am-fixed { overflow: visible; }
.am-fixed .service-auth-wall.am-auth { margin: 2px 2px 2px 0; }

/* stylesheet.css содержит #resultsContainer { box-shadow; border-radius } с !important —
   перебиваем по ID (специфичность выше), иначе вокруг результата рисуется лишняя рамка. */
#serviceAnalizy #resultsContainer.am-results { box-shadow: none !important; border-radius: 0 !important; }

/* Шаг «подтвердите e-mail»: миниатюра и ссылка «Расшифровать другой анализ» не нужны */
.am-fixed .am-results__thumb { display: none; }
.am-results.am-fixed:not(.am-single) #newAnalysisBtn { display: none; }

/* Строка «имя · размер» под формой не нужна — данные показываются в дропзоне */
.service-widget-analizy .medical-upload__file-info { display: none !important; }
.service-widget-analizy .am-drop-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Десктоп: уведомления не занимают место в карточке — пилюля по центру верха зоны загрузки,
   в палитре интерфейса (белое стекло + градиентная рамка бренда, круглая иконка). */
@keyframes am-toast-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes am-toast-icon { 0%, 100% { box-shadow: 0 0 0 0 rgba(8,116,249,.35); } 50% { box-shadow: 0 0 0 5px rgba(8,116,249,0); } }
@media (min-width: 992px) {
	.service-widget-analizy { position: relative; }
	.service-widget-analizy > .svc-toast {
		--tc1: #0874f9; --tc2: #7c5cff; --tg: rgba(8,116,249,.35);
		position: absolute; top: 14px; left: calc((100% - 24px) * .242); z-index: 20;
		display: flex; align-items: center; gap: 9px; width: max-content; max-width: calc((100% - 24px) * .484 - 16px); margin: 0;
		padding: 6px 14px 6px 7px; border: 1.5px solid transparent; border-radius: 16px; color: #071537;
		background: linear-gradient(rgba(255,255,255,.97), rgba(255,255,255,.97)) padding-box, linear-gradient(100deg, var(--tc1), var(--tc2)) border-box;
		box-shadow: 0 12px 26px -12px var(--tg), 0 2px 6px rgba(8,21,55,.05);
		-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
		font: 600 12.5px/1.25 Inter, sans-serif; letter-spacing: -.01em; transform: translateX(-50%);
		animation: am-toast-in .55s var(--am-spring) both;
	}
	.service-widget-analizy > .svc-toast.error { --tc1: #ff5c7a; --tc2: #dc2626; --tg: rgba(220,38,38,.35); }
	.service-widget-analizy > .svc-toast::before { content: '!'; flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--tc1), var(--tc2)); font: 800 12px/1 Inter, sans-serif; animation: am-toast-icon 2.2s ease-out infinite; }
	.service-widget-analizy > .svc-toast.error::before { animation: none; }
	.service-widget-analizy > .svc-toast .svc-toast-close { margin: 0 -6px 0 2px; padding: 0 4px; border: 0; background: none; color: #7180ac; font-size: 16px; line-height: 1; opacity: .7; cursor: pointer; }
	.service-widget-analizy > .svc-toast .svc-toast-close:hover { color: #071537; opacity: 1; background: none; }
}

/* Демо-результат (тизер) — без прокрутки: компактно и с обрезкой по высоте */
.am-results.am-fixed:not(.am-single) .am-res-body { overflow: hidden; }
.am-results.am-fixed:not(.am-single) .am-res-text { padding: 6px 8px 0; }
.am-results.am-fixed:not(.am-single) .am-line { padding: 6px 10px 6px 34px; font-size: 14px; line-height: 1.5; }
.am-results.am-fixed:not(.am-single) .am-line::before { left: 12px; top: 13px; width: 9px; height: 9px; }
.am-results.am-fixed:not(.am-single) .am-locked { margin: 2px 8px 6px; padding: 8px 10px; gap: 8px; }
.am-results.am-fixed:not(.am-single) .am-locked__bar { height: 10px; }
.am-results.am-fixed:not(.am-single) .am-locked__bar:nth-child(4) { display: none; }

/* Длинное имя файла не должно расталкивать колонки формы */
.service-widget-analizy .medical-upload__dropzone { min-width: 0; overflow: hidden; }
.service-widget-analizy .medical-upload__dropzone-title.am-drop-name { display: block; width: 100%; padding: 0 8px; text-align: center; box-sizing: border-box; }
.service-widget-analizy .medical-upload__dropzone-description { max-width: 100%; }

@media (min-width: 992px) {
	/* когда в зоне загрузки есть плашка — сдвигаем содержимое вниз, чтобы не касалось */
	.service-widget-analizy > .svc-toast ~ .medical-upload .medical-upload__dropzone { padding-top: 44px; }
}

/* ==========================================================================
   Панель «Бесплатная попытка использована» / «Лимит тарифа исчерпан» (#amGate).
   Появляется по нажатию на кнопку, накрывает всю карточку.
   Гость — форма e-mail → код, вошедший клиент — тарифы.
   ========================================================================== */
.am-gate[hidden] { display: none !important; }
.service-widget-analizy { position: relative; }
/* панель лежит внутри виджета (чтобы работали его стили), но перекрывает всю карточку вместе с её внутренними отступами */
.am-gate { position: absolute; inset: -24px; z-index: 12; display: flex; align-items: center; padding: 22px 30px; border-radius: 28px; overflow: hidden; opacity: 0; transform: scale(.97); transition: opacity .45s ease, transform .6s var(--am-ease); background: radial-gradient(120% 100% at 0% 0%, rgba(232,242,255,.97), rgba(255,255,255,.98) 58%), #fff; }
.am-gate.is-open { opacity: 1; transform: none; }
.am-gate::before, .am-gate::after { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; filter: blur(70px); opacity: .45; pointer-events: none; animation: am-float 7s ease-in-out infinite alternate; }
.am-gate::before { left: -120px; top: -150px; background: rgba(8,116,249,.35); }
.am-gate::after { right: -120px; bottom: -170px; background: rgba(124,92,255,.32); animation-delay: -3s; }

.am-gate__close { position: absolute; top: 16px; right: 16px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(8,116,249,.16); border-radius: 50%; color: #5d6b96; background: rgba(255,255,255,.9); cursor: pointer; transition: transform .3s var(--am-spring), color .2s ease, background-color .2s ease, border-color .2s ease; }
.am-gate__close:hover, .am-gate__close:focus { color: #071537; background: #fff; border-color: rgba(8,116,249,.4); transform: rotate(90deg); }

.am-gate__inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center; gap: 34px; width: 100%; }
.am-gate.is-open .am-gate__info { animation: am-rise .7s .1s var(--am-ease) both; }
.am-gate.is-open .am-gate__body { animation: am-rise .7s .22s var(--am-ease) both; }

.am-gate__badge { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 14px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--am-blue), var(--am-violet)); box-shadow: 0 14px 28px -10px rgba(8,116,249,.7); }
.am-gate.is-open .am-gate__badge { animation: am-pop .7s .15s var(--am-spring) both; }
.service-widget-analizy .am-gate__title { margin: 0 0 8px; color: var(--am-ink); font: 800 24px/1.12 Inter, sans-serif; letter-spacing: -.045em; }
.service-widget-analizy .am-gate__text { margin: 0; color: var(--am-muted); font: 400 14px/1.45 Inter, sans-serif; }
.am-gate__cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 20px; border-radius: 14px; color: #fff !important; background: linear-gradient(100deg, var(--am-blue), var(--am-violet)); box-shadow: 0 14px 28px -12px rgba(8,116,249,.7); font: 600 14.5px/1 Inter, sans-serif; text-decoration: none !important; transition: transform .25s var(--am-ease), box-shadow .3s ease; }
.am-gate__cta:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(8,116,249,.85); }
.am-gate__cta svg { transition: transform .3s var(--am-spring); }
.am-gate__cta:hover svg { transform: translateX(3px); }

/* форма e-mail внутри панели: без собственной карточки, заголовок не нужен (он слева) */
.service-widget-analizy .am-gate .service-auth-wall.am-auth { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; animation: none; }
.am-gate .am-auth__head { display: none; }
.am-gate #quick-register-step-1.is-active { grid-template-columns: 1fr; }
.am-gate .am-msg:not(:empty) { margin-top: 8px; }

/* тарифы */
.am-plans { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; max-height: 232px; overflow: auto; }
.am-plan { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border: 1px solid rgba(8,116,249,.14); border-radius: 16px; background: rgba(255,255,255,.85); box-shadow: 0 10px 24px -16px rgba(8,116,249,.45); opacity: 0; animation: am-rise .6s calc(var(--i, 0) * 90ms + .3s) var(--am-ease) both; transition: transform .25s var(--am-ease), box-shadow .25s ease, border-color .25s ease; }
.am-plan:hover { transform: translateY(-2px); border-color: rgba(8,116,249,.35); box-shadow: 0 16px 30px -16px rgba(8,116,249,.6); }
.am-plan__main { min-width: 0; }
.am-plan__main strong { display: block; color: var(--am-ink); font: 700 15px/1.2 Inter, sans-serif; letter-spacing: -.02em; }
.am-plan__main small { display: block; margin-top: 3px; color: var(--am-muted); font: 400 12px/1.3 Inter, sans-serif; }
.am-plan__side { display: grid; justify-items: end; gap: 5px; flex: 0 0 auto; }
.am-plan__price { color: var(--am-ink); font: 700 14px/1 Inter, sans-serif; white-space: nowrap; }
.am-plan__soon { padding: 3px 9px; border-radius: 999px; color: #0874f9; background: #eaf2ff; font: 700 11px/1.2 Inter, sans-serif; letter-spacing: .02em; }

@media (max-width: 991px) {
	.am-gate { inset: -18px; align-items: flex-start; padding: 26px 18px 22px; overflow: auto; }
	.am-gate__inner { grid-template-columns: 1fr; gap: 20px; }
	.am-plans { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
	.am-gate, .am-gate::before, .am-gate::after, .am-gate.is-open .am-gate__info, .am-gate.is-open .am-gate__body, .am-gate.is-open .am-gate__badge, .am-plan { animation: none !important; transition: none; opacity: 1; }
}

/* Выбор пола: линейные SVG-иконки вместо эмодзи */
.service-widget-analizy .gender-option { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 9px; }
.service-widget-analizy .gender-option span { line-height: 1; }
.service-widget-analizy .am-gender-ico { flex: 0 0 auto; transition: transform .45s var(--am-spring), color .2s ease; }
.service-widget-analizy .gender-option:hover .am-gender-ico { transform: scale(1.12); }
.service-widget-analizy .gender-option.active .am-gender-ico { animation: am-gender-pop .5s var(--am-spring); }
@keyframes am-gender-pop { 0% { transform: scale(.6) rotate(-18deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .service-widget-analizy .gender-option.active .am-gender-ico { animation: none; } }
