[hidden] { display: none !important; }

:root {
    --flow-input: rgba(255, 255, 255, 0.72);
    --flow-soft: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] {
    --flow-input: rgba(11, 18, 32, 0.7);
    --flow-soft: rgba(15, 23, 42, 0.55);
}

.flow-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 44px 20px 64px;
}

#duoWizard > .eyebrow {
    display: flex;
    justify-content: center;
}

#duoWizard > h1 {
    max-width: 760px;
    margin: 14px auto 0;
    font-size: clamp(32px, 4.4vw, 52px);
    font-weight: 780;
    line-height: 1.05;
    letter-spacing: -0.045em;
    text-align: center;
}

#duoWizard > .lede {
    max-width: 600px;
    margin: 14px auto 0;
    text-align: center;
    font-size: 15px;
}

.progress {
    display: flex;
    gap: 8px;
    max-width: 760px;
    margin: 26px auto 20px;
    padding: 0;
    list-style: none;
    counter-reset: flow-step;
}

.progress li {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress li::before {
    counter-increment: flow-step;
    content: counter(flow-step, decimal-leading-zero) "  ";
    color: var(--purple);
}

.progress li.current {
    border-color: transparent;
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 10px 24px rgba(76, 92, 246, 0.3);
}

.progress li.current::before {
    color: #fff;
}

.progress li.completed {
    border-color: rgba(20, 184, 166, 0.4);
    color: var(--ink);
}

.card {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    box-shadow: var(--shadow);
}

.card h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 720;
    letter-spacing: -0.03em;
}

.section-copy {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.field.full {
    grid-column: 1 / -1;
}

.field input,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--flow-input);
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
    color: var(--muted-2);
}

.field input:hover,
.field select:hover {
    border-color: var(--muted-2);
}

.field input:focus-visible,
.field select:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.18);
}

.help,
.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    padding: 4px;
    border: 1px solid var(--glass-border);
    border-radius: 13px;
    background: var(--flow-soft);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.tabs button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tabs button[aria-pressed="true"] {
    background: var(--glass-strong);
    border-color: var(--glass-border);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.panel {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--flow-soft);
}

.account p {
    max-width: 460px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.translate-cta {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #7657f6, #a45cff);
    color: #fff;
    text-align: left;
    box-shadow: 0 14px 30px rgba(118, 87, 246, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.translate-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(118, 87, 246, 0.36);
}

.translate-cta .spark {
    font-size: 24px;
    line-height: 1;
}

.translate-cta strong,
.translate-cta small {
    display: block;
}

.translate-cta strong {
    font-size: 15px;
    font-weight: 700;
}

.translate-cta small {
    margin-top: 2px;
    color: #f1eaff;
    font-size: 11.5px;
}

.preview {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    margin: 4px 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: radial-gradient(ellipse at 50% 20%, #263952, #101827 85%);
    overflow: hidden;
    color: #dce9ff;
}

.preview video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #05070b;
}

.preview .avatar {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 1px solid rgba(145, 180, 239, 0.3);
    border-radius: 50%;
    background: rgba(55, 97, 155, 0.25);
    font-size: 30px;
    font-weight: 650;
}

.preview .hint {
    position: absolute;
    left: 14px;
    bottom: 12px;
    color: var(--stage-muted, #a9b8cf);
    font-size: 12px;
}

.meter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.meter {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: var(--line-strong);
    overflow: hidden;
}

.meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #14b8a6);
    transition: width 0.12s linear;
}

.meter-row output {
    min-width: 96px;
    text-align: right;
}

.media-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.media-actions .button {
    width: 100%;
    min-height: 50px;
    justify-content: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.55;
    transform: none;
}

.button.primary {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 26px rgba(76, 92, 246, 0.3);
}

.button.primary:hover:not(:disabled) {
    box-shadow: 0 16px 34px rgba(76, 92, 246, 0.38);
}

.button.secondary {
    background: var(--glass-strong);
    border-color: var(--glass-border);
    color: var(--ink);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-soft);
}

.button.secondary:hover:not(:disabled) {
    background: var(--glass-hover);
}

.button.ghost {
    background: transparent;
    color: var(--muted);
}

.button.ghost:hover:not(:disabled) {
    background: var(--flow-soft);
    color: var(--ink);
}

.button.enabled {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(76, 92, 246, 0.28);
}

.notice {
    margin-top: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(36, 99, 235, 0.18);
    border-radius: 12px;
    background: rgba(36, 99, 235, 0.08);
    color: var(--blue-ink);
    font-size: 13px;
    line-height: 1.6;
}

.alert {
    margin-top: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(220, 53, 69, 0.22);
    border-radius: 12px;
    background: rgba(220, 53, 69, 0.08);
    color: #d43a4a;
    font-size: 13px;
    line-height: 1.6;
}

html[data-theme="dark"] .alert {
    color: #ff8a94;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.footer-actions .button.primary {
    flex: 1;
    min-height: 50px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-2);
}

.badge.ok::before {
    background: #22c55e;
}

.badge.pending::before {
    background: #f59e0b;
}

.flow-dialog {
    width: min(440px, calc(100vw - 24px));
    padding: 24px;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    color: var(--ink);
    box-shadow: 0 30px 80px rgba(7, 11, 20, 0.4);
}

.flow-dialog::backdrop {
    background: rgba(7, 11, 20, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.flow-dialog .dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.flow-dialog .dialog-head h2 {
    margin-top: 6px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.flow-dialog .panel {
    margin-top: 8px;
}

.dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.dialog-actions .button {
    flex: 1;
}

.flow-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 400;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    color: var(--ink);
    font-size: 13px;
    text-align: center;
    box-shadow: var(--shadow);
    transform: translateX(-50%);
}

.flow-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px 26px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 12px;
}

.flow-footer-links {
    display: flex;
    gap: 16px;
}

.flow-footer-links a {
    color: var(--muted);
}

.flow-footer-links a:hover {
    color: var(--ink);
}

@media (max-width: 760px) {
    .flow-main {
        padding: 30px 14px 48px;
    }

    #duoWizard > h1 {
        font-size: clamp(30px, 9vw, 40px);
    }

    .progress {
        gap: 5px;
        margin: 20px auto 16px;
    }

    .progress li {
        padding: 8px 7px;
        font-size: 9.5px;
        border-radius: 10px;
    }

    .card {
        padding: 20px;
        border-radius: 22px;
    }

    .field-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .footer-actions {
        flex-wrap: wrap;
    }

    .footer-actions .button.primary {
        width: 100%;
        order: -1;
    }

    .flow-footer {
        padding-inline: 14px;
    }

    .flow-footer-links {
        gap: 12px;
    }
}

@media (max-width: 420px) {
    .progress li {
        font-size: 8.5px;
        letter-spacing: 0;
    }

    .account {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button,
    .translate-cta,
    .tabs button {
        transition: none;
    }
}
