/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #f4f4f6;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8f8fa;
    --bg-header: #3a3a3a;
    --bg-footer: #2c2c2c;
    --border: #e0e0e4;
    --border-focus: #e3511a;
    --text-primary: #222222;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-header: #ffffff;
    --accent: #e3511a;
    --accent-hover: #c94516;
    --success: #2d8a4e;
    --error: #c9302c;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ── */
.header {
    background: var(--bg-header);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
}

.header__inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header__logo-img {
    height: 38px;
    width: auto;
}

.header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Language Switch ── */
.lang-switch {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px;
}

.lang-switch[hidden] {
    display: none;
}

.lang-switch__btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.lang-switch__btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.lang-switch__btn--active {
    background: var(--accent);
    color: #fff;
}

/* ── Main ── */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

#state-progress,
#state-result,
#state-error {
    max-width: 640px;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 48px 0 24px;
}

.hero__title {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.hero__subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* ── Form ── */
.form-section {
    padding-bottom: 48px;
}

/* ── Mode Selector ── */
.mode-selector {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 22px;
}

.mode-selector__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-selector__btn:hover {
    color: var(--text-primary);
}

.mode-selector__btn--active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-selector__btn--active:hover {
    color: var(--text-primary);
}

.mode-selector__icon {
    width: 16px;
    height: 16px;
}

.audit-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    max-width: 640px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px 11px 38px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font);
    transition: border-color 0.2s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input.invalid {
    border-color: var(--error);
}

.form-error {
    background: rgba(201, 48, 44, 0.06);
    border: 1px solid rgba(201, 48, 44, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--error);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
    margin-top: 12px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.form-hint__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

.btn-primary--large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    margin-top: 10px;
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ── Queue Overlay ── */
.queue-overlay {
    text-align: center;
    padding: 64px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.queue-overlay__spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    margin: 0 auto 24px;
    animation: queueSpin 1s linear infinite;
}

@keyframes queueSpin {
    to {
        transform: rotate(360deg);
    }
}

.queue-overlay__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.queue-overlay__message {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

.queue-overlay__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.queue-overlay__timer-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Hidden overrides for flex/grid elements */
.queue-overlay[hidden],
.progress-section[hidden],
.log-section[hidden],
.tip-section[hidden] {
    display: none;
}

/* ── Progress ── */
.progress-section {
    text-align: center;
    padding: 48px 0 24px;
}

.progress__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.progress-bar-wrap {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress__percent {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* ── Log ── */
.log-section {
    padding-bottom: 20px;
}

.log__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.log-entries {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    min-height: 100px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
    animation: fadeInLog 0.3s ease;
}

.log-entry__icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.log-entry__icon--done {
    color: var(--success);
}

.log-entry__icon--running {
    color: var(--accent);
    animation: pulse 1.2s ease-in-out infinite;
}

.log-entry__icon--pending {
    color: var(--text-muted);
}

.log-entry__text {
    color: var(--text-secondary);
}

.log-entry__text--active {
    color: var(--text-primary);
    font-weight: 500;
}

.log-entry__text--done {
    color: var(--text-primary);
    font-weight: 600;
}

@keyframes fadeInLog {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ── Progress Info ── */
.progress-info {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 0 0 40px;
}

.progress-info[hidden] {
    display: none;
}

.progress-info__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

/* ── Tip Card ── */
.tip-section {
    padding-bottom: 48px;
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 18px 20px;
}

.tip-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tip-card__icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.tip-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
}

.tip-card__text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    transition: opacity 0.4s ease;
}

/* ── Result ── */
.result-section {
    text-align: center;
    padding: 40px 0 4px;
}

.result__icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(45, 138, 78, 0.08);
    border: 2px solid var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: floatIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.result__check-icon {
    width: 28px;
    height: 28px;
    color: var(--success);
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.result__title {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.result__info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Result Preview ── */
.result-preview {
    position: relative;
    width: 860px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 0 36px;
}

.result-preview__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
}

.result-preview__cards {
    display: flex;
    gap: 20px;
}

.result-preview__more {
    font-size: 13px;
    color: var(--accent);
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
}

.rec-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rec-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.rec-card--good {
    border-left: 3px solid var(--success);
}

.rec-card--warn {
    border-left: 3px solid #e8a317;
}

.rec-card--bad {
    border-left: 3px solid var(--error);
}

.rec-card__icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(227, 81, 26, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.rec-card__icon-wrap--good {
    background: rgba(45, 138, 78, 0.08);
}

.rec-card__icon-wrap--good .rec-card__icon {
    color: var(--success);
}

.rec-card__icon-wrap--warn {
    background: rgba(232, 163, 23, 0.08);
}

.rec-card__icon-wrap--warn .rec-card__icon {
    color: #e8a317;
}

.rec-card__icon-wrap--bad {
    background: rgba(201, 48, 44, 0.08);
}

.rec-card__icon-wrap--bad .rec-card__icon {
    color: var(--error);
}

.rec-card__icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.rec-card__measure {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.rec-card__effect {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-actions {
    text-align: center;
    padding-bottom: 48px;
}

/* ── Error ── */
.error-section {
    text-align: center;
    padding: 64px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error__icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(201, 48, 44, 0.08);
    border: 2px solid var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.error__x-icon {
    width: 28px;
    height: 28px;
    color: var(--error);
}

.error__title {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.error__message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ── How It Works ── */
.how-it-works {
    padding: 32px 0 48px;
    max-width: 1200px;
    width: calc(100vw - 48px);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.how-it-works__title {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.how-it-works__intro {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 460px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

.hiw-steps {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
}

.hiw-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 24px 20px;
    text-align: center;
    position: relative;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hiw-step:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(227, 81, 26, 0.08);
}

.hiw-step__number {
    position: absolute;
    top: -16px;
    left: 20px;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hiw-step__icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(227, 81, 26, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.hiw-step__icon-wrap--shopify {
    background: rgba(150, 191, 72, 0.1);
}

.hiw-step__icon-wrap--shopify .hiw-step__icon {
    color: #96bf48;
}

.hiw-step__icon-wrap--ai {
    background: rgba(99, 102, 241, 0.08);
}

.hiw-step__icon-wrap--ai .hiw-step__icon {
    color: #6366f1;
}

.hiw-step__icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.hiw-step__heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.hiw-step__text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.hiw-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    flex-shrink: 0;
}

.hiw-connector__icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
}
/* ── Fiverr Teaser ── */
.fiverr-teaser {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

.fiverr-teaser__text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
    padding: 16px 24px;
    background: rgba(201, 48, 44, 0.04);
    border: 1px solid rgba(201, 48, 44, 0.12);
    border-radius: 8px;
}

/* ── Footer ── */
.footer {
    background: var(--bg-footer);
    padding: 20px 24px;
}

.footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.footer__link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .hero {
        padding: 32px 0 20px;
    }

    .hero__title {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .audit-form {
        padding: 20px 16px;
    }

    .btn-primary--large {
        padding: 13px 20px;
        font-size: 15px;
    }

    .header__logo-img {
        height: 22px;
    }

    .how-it-works {
        padding: 24px 0 32px;
    }

    .how-it-works__title {
        font-size: 17px;
    }

    .hiw-steps {
        flex-direction: column;
    }

    .hiw-connector {
        padding: 6px 0;
    }

    .hiw-connector__icon {
        transform: rotate(0deg);
    }

    .hiw-step {
        padding: 20px 16px 16px;
    }

    .result-preview__cards {
        flex-direction: column;
    }

    .result-preview {
        width: 100%;
        left: 0;
        transform: none;
    }
}