/* ============================================================
   cards/team/team.css — Карточка «Доступ в команду»
   Отдельный модуль. Ничего из основного приложения не трогает:
   все классы со скоупом .team-* / #view-team.
   Палитра: золото #f59e0b -> изумруд #10b981 поверх тёмного стекла.
   ============================================================ */

/* ---------- Плашка на главном экране ----------
   Та же разметка и размер, что у остальных плашек (glass-card + red-circle-btn).
   Отличие только в оранжевой окантовке. */
.team-home-card { border: 1px solid rgba(245, 158, 11, 0.38) !important; }
.team-pill-open {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.38) !important;
    color: #fcd34d !important;
}

/* ---------- Сцена (внутри view-team) ---------- */
#view-team.view-section.active { padding: 0 16px; }

.team-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 24px;
    isolation: isolate;
    padding-bottom: 4px;
}

/* Живой фон: два мягких пятна, медленно дышат и двигаются */
.team-aurora {
    position: absolute; inset: -30% -10% -10% -10%;
    z-index: -1; pointer-events: none; filter: blur(42px);
}
.team-aurora span {
    position: absolute; display: block; border-radius: 50%; opacity: 0.55;
}
.team-aurora .a1 {
    width: 240px; height: 240px; top: -40px; left: -30px;
    background: radial-gradient(circle, rgba(245,158,11,0.55), transparent 65%);
    animation: teamFloat1 11s ease-in-out infinite;
}
.team-aurora .a2 {
    width: 260px; height: 260px; bottom: -60px; right: -40px;
    background: radial-gradient(circle, rgba(16,185,129,0.50), transparent 65%);
    animation: teamFloat2 13s ease-in-out infinite;
}
.team-aurora .a3 {
    width: 180px; height: 180px; top: 40%; left: 40%;
    background: radial-gradient(circle, rgba(59,130,246,0.30), transparent 65%);
    animation: teamFloat1 15s ease-in-out infinite reverse;
}

/* ---------- Прогресс ---------- */
.team-progress {
    display: flex; align-items: center; gap: 6px;
    padding: 18px 6px 2px 6px;
}
.team-progress .dot {
    height: 4px; flex: 1; border-radius: 4px;
    background: rgba(255,255,255,0.09);
    overflow: hidden; position: relative;
}
.team-progress .dot.done { background: rgba(16,185,129,0.85); }
.team-progress .dot.active::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, #fbbf24, #10b981);
    transform-origin: left;
    animation: teamFill 0.5s cubic-bezier(0.22,0.9,0.3,1) forwards;
}

/* ---------- Шаг ---------- */
.team-step { padding: 10px 6px 20px 6px; }
.team-step.in > * { opacity: 0; transform: translateY(14px); animation: teamUp 0.55s cubic-bezier(0.22,0.9,0.3,1) forwards; }
.team-step.in > *:nth-child(1) { animation-delay: 0.02s; }
.team-step.in > *:nth-child(2) { animation-delay: 0.09s; }
.team-step.in > *:nth-child(3) { animation-delay: 0.16s; }
.team-step.in > *:nth-child(4) { animation-delay: 0.23s; }
.team-step.in > *:nth-child(5) { animation-delay: 0.30s; }
.team-step.in > *:nth-child(6) { animation-delay: 0.37s; }
.team-step.in > *:nth-child(7) { animation-delay: 0.44s; }
.team-step.in > *:nth-child(8) { animation-delay: 0.51s; }

/* Эмблема */
.team-emblem {
    width: 68px; height: 68px; margin: 4px auto 12px auto;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), rgba(0,0,0,0.1));
    border: 1px solid rgba(245,158,11,0.40);
    box-shadow: 0 0 0 6px rgba(245,158,11,0.06), 0 14px 34px rgba(0,0,0,0.5);
    position: relative;
    animation: teamBob 4s ease-in-out infinite;
}
.team-emblem { font-size: 30px; }
.team-emblem svg { width: 32px; height: 32px; }
.team-emblem::before {
    content: ""; position: absolute; inset: -8px; border-radius: 50%;
    border: 1px solid rgba(16,185,129,0.25);
    animation: teamRing 3.4s ease-out infinite;
}

.team-kicker {
    text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
    text-transform: uppercase; color: #fcd34d; margin-bottom: 8px;
}
.team-title {
    text-align: center; font-size: 23px; font-weight: 900; line-height: 1.15;
    margin-bottom: 10px; letter-spacing: 0.2px;
    background: linear-gradient(90deg, #fbbf24, #ffffff 50%, #34d399);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.team-title.sm { font-size: 20px; }
.team-sub {
    text-align: center; font-size: 13px; line-height: 1.55; color: #c7cbd1;
    margin: 0 auto 18px auto; max-width: 320px;
}
.team-sub b { color: #fff; font-weight: 800; }

/* Список активаций (перки) */
.team-perks {
    display: flex; flex-direction: column; gap: 7px; margin: 18px 0 6px 0;
}
.team-perk {
    display: flex; align-items: center; gap: 11px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 13px; padding: 8px 12px;
}
.team-perk .ic {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(16,185,129,0.18));
    border: 1px solid rgba(255,255,255,0.08);
}
.team-perk .tx { font-size: 12.5px; color: #e5e7eb; font-weight: 600; line-height: 1.35; }
.team-perk .tx small { display: block; color: #8b9099; font-weight: 500; font-size: 11px; margin-top: 1px; }

/* Вопрос + варианты-кнопки */
.team-q {
    text-align: center; font-size: 18px; font-weight: 900; color: #fff;
    line-height: 1.25; margin: 4px auto 16px auto; max-width: 320px;
}
.team-q .n {
    display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px;
    color: #fcd34d; text-transform: uppercase; margin-bottom: 8px;
}
.team-opts { display: flex; flex-direction: column; gap: 10px; }
.team-opt {
    position: relative; width: 100%;
    text-align: left; font-size: 14px; font-weight: 700; color: #e7e9ee;
    background: rgba(18, 21, 28, 0.8);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px; padding: 15px 46px 15px 16px;
    cursor: pointer; transition: transform 0.12s, border-color 0.18s, background 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.team-opt .em { margin-right: 9px; }
.team-opt::after {
    content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: #6b7280; font-size: 20px; font-weight: 700; transition: color 0.18s, transform 0.18s;
}
.team-opt:active { transform: scale(0.98); }
.team-opt:hover { border-color: rgba(245,158,11,0.45); }
.team-opt.picked {
    border-color: rgba(16,185,129,0.65);
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(16,185,129,0.14));
}
.team-opt.picked::after { content: "✓"; color: #34d399; }

/* Печатает... (пул ответов) */
.team-typing {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 26px; margin: 10px 0 2px 0;
}
.team-typing i {
    width: 8px; height: 8px; border-radius: 50%; background: #fcd34d; opacity: 0.4;
    animation: teamBlink 1.2s infinite both;
}
.team-typing i:nth-child(2) { animation-delay: 0.18s; }
.team-typing i:nth-child(3) { animation-delay: 0.36s; background: #34d399; }

.team-ack {
    text-align: center; font-size: 15px; font-weight: 700; color: #e7e9ee;
    line-height: 1.5; margin: 2px auto 4px auto; max-width: 320px;
}

/* Загрузка с процентами после ответа «принял» */
.team-load { max-width: 320px; margin: 22px auto 0 auto; }
.team-load-row {
    display: flex; justify-content: flex-end; align-items: baseline;
    font-size: 12px; font-weight: 700; color: #9aa0a8; margin-bottom: 8px;
}
.team-load-row b { font-size: 14px; font-weight: 900; color: #fcd34d; }
.team-load-track {
    height: 7px; border-radius: 10px; overflow: hidden;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.05);
}
.team-load-fill {
    height: 100%; width: 0%; border-radius: 10px;
    background: linear-gradient(90deg, #fbbf24, #10b981);
    box-shadow: 0 0 12px rgba(245,158,11,0.55);
    transition: width 0.08s linear;
}

/* Статус ожидания постбэка */
.team-status {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin-top: 16px; font-size: 12.5px; font-weight: 700; color: #9aa0a8;
}
.team-status .live {
    width: 9px; height: 9px; border-radius: 50%; background: #fbbf24;
    box-shadow: 0 0 0 0 rgba(251,191,36,0.6); animation: teamLive 1.5s ease-out infinite;
}
.team-status.ok { color: #34d399; }
.team-status.ok .live { background: #34d399; animation: none; box-shadow: none; }

/* Кнопки действий */
.team-cta {
    position: relative; overflow: hidden;
    width: 100%; border: none; cursor: pointer;
    padding: 17px 16px; border-radius: 16px;
    font-size: 15px; font-weight: 900; letter-spacing: 0.3px; text-transform: uppercase;
    color: #0b0c10;
    background: linear-gradient(100deg, #fbbf24, #f59e0b 45%, #10b981);
    background-size: 180% 100%;
    box-shadow: 0 10px 26px rgba(245,158,11,0.32), inset 0 1px 0 rgba(255,255,255,0.35);
    transition: transform 0.12s;
    animation: teamShift 5s ease infinite;
    display: flex; align-items: center; justify-content: center; gap: 9px;
}
.team-cta:active { transform: scale(0.98); }
.team-cta::after {
    content: ""; position: absolute; top: 0; left: -70%;
    width: 45%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-18deg); animation: teamSheen 3.2s ease-in-out infinite;
}
.team-cta.mt { margin-top: 16px; }

/* Кнопки брокеров (рег/деп) — своя идентичность на кнопке, в тексте диалога брокер не называем */
.team-brokers { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.team-broker {
    position: relative; width: 100%; cursor: pointer;
    display: flex; align-items: center; gap: 13px;
    padding: 14px 16px; border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(18, 21, 28, 0.85);
    transition: transform 0.12s, border-color 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.team-broker:active { transform: scale(0.98); }
.team-broker:hover { border-color: rgba(245,158,11,0.5); }
.team-broker img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex-shrink: 0; background: rgba(255,255,255,0.04); }
.team-broker .bt { flex: 1; text-align: left; }
.team-broker .bt b { display: block; font-size: 14px; font-weight: 800; color: #fff; }
.team-broker .bt small { font-size: 11px; color: #8b9099; font-weight: 600; }
.team-broker .go {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-weight: 900; color: #0b0c10;
    background: linear-gradient(135deg, #fbbf24, #10b981);
    box-shadow: 0 0 14px rgba(245,158,11,0.5);
}

.team-ghost {
    width: 100%; background: transparent; border: none; cursor: pointer;
    color: #8b9099; font-size: 12.5px; font-weight: 700; padding: 12px; margin-top: 6px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.team-ghost:hover { color: #cbd5e1; }
.team-ghost u { text-decoration-color: rgba(255,255,255,0.3); }

/* Сноска под «На главную» на шагах рег/деп */
.team-note {
    text-align: center; font-size: 11px; line-height: 1.5; color: #7c828b;
    max-width: 320px; margin: 4px auto 0 auto; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.team-hint {
    text-align: center; font-size: 11px; color: #6b7280; line-height: 1.5;
    margin-top: 14px;
}

/* Галочка «готово» */
.team-check {
    width: 78px; height: 78px; margin: 4px auto 14px auto; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 25%, rgba(52,211,153,0.35), rgba(16,185,129,0.1));
    border: 1px solid rgba(16,185,129,0.5);
    box-shadow: 0 0 0 7px rgba(16,185,129,0.07);
}
.team-check svg { width: 42px; height: 42px; }
.team-check path {
    stroke: #34d399; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48; animation: teamDraw 0.6s ease-out 0.15s forwards;
}

/* ---------- ФИНАЛ: добро пожаловать в команду ---------- */
.team-final-emblem {
    width: 104px; height: 104px; margin: 2px auto 18px auto; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 46px;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22), rgba(0,0,0,0.12));
    border: 1px solid rgba(245,158,11,0.5);
    box-shadow: 0 0 0 8px rgba(245,158,11,0.07), 0 18px 44px rgba(0,0,0,0.55);
    animation: teamPop 0.7s cubic-bezier(0.175,0.885,0.32,1.275) both, teamBob 4s ease-in-out 0.7s infinite;
}
.team-primary {
    position: relative; overflow: hidden;
    width: 100%; border: none; cursor: pointer; text-decoration: none;
    padding: 16px; border-radius: 16px; margin-top: 4px;
    font-size: 15px; font-weight: 900; letter-spacing: 0.3px; color: #0b0c10;
    background: linear-gradient(100deg, #fbbf24, #10b981);
    box-shadow: 0 10px 26px rgba(16,185,129,0.3), inset 0 1px 0 rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: transform 0.12s;
}
.team-primary:active { transform: scale(0.98); }
.team-secondary {
    width: 100%; cursor: pointer; text-decoration: none; margin-top: 11px;
    padding: 15px; border-radius: 15px;
    font-size: 13.5px; font-weight: 800; color: #e7e9ee;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center; gap: 9px;
    transition: transform 0.12s, border-color 0.18s;
}
.team-secondary:active { transform: scale(0.98); }
.team-secondary:hover { border-color: rgba(59,130,246,0.5); }
.team-secondary .pw { color: #60a5fa; }

/* Конфетти на финале */
.team-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.team-confetti i {
    position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; opacity: 0;
    animation: teamConfetti 2.4s ease-in forwards;
}

/* ---------- Keyframes ---------- */
@keyframes teamUp { to { opacity: 1; transform: translateY(0); } }
@keyframes teamFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes teamSheen {
    0% { left: -70%; } 55% { left: 130%; } 100% { left: 130%; }
}
@keyframes teamShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes teamBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes teamRing { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes teamPulseBtn { 0%,100% { box-shadow: 0 0 14px rgba(245,158,11,0.45); } 50% { box-shadow: 0 0 26px rgba(16,185,129,0.65); } }
@keyframes teamBlink { 0%,60%,100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes teamLive { 0% { box-shadow: 0 0 0 0 rgba(251,191,36,0.55); } 70% { box-shadow: 0 0 0 9px rgba(251,191,36,0); } 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); } }
@keyframes teamDraw { to { stroke-dashoffset: 0; } }
@keyframes teamPop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes teamFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,24px) scale(1.12); } }
@keyframes teamFloat2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px,-20px) scale(1.15); } }
@keyframes teamConfetti {
    0% { opacity: 0; transform: translateY(0) rotate(0deg); }
    12% { opacity: 1; }
    100% { opacity: 0.9; transform: translateY(560px) rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
    .team-aurora span, .team-emblem, .team-final-emblem, .team-cta,
    .team-cta::after { animation: none !important; }
    .team-step.in > * { opacity: 1; transform: none; animation: none; }
}
