.autocrm-front {
    --ag-primary: #2563eb;
    --ag-primary-600: #1d4ed8;
    --ag-accent: #fda4af;
    --ag-ink: #0f172a;
    --ag-muted: #64748b;
    --ag-border: #e2e8f0;
    --ag-bg: #f8fafc;
    --ag-card: #ffffff;
    --ag-success: #16a34a;
    --ag-warning: #f59e0b;
    font-family: "Sora", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ag-ink);
}

.autocrm-front * {
    box-sizing: border-box;
}

.autocrm-hero {
    background: radial-gradient(1200px 400px at 10% -20%, rgba(37, 99, 235, 0.25), transparent),
                radial-gradient(900px 400px at 90% 0%, rgba(253, 164, 175, 0.20), transparent),
                var(--ag-bg);
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 24px;
}

.autocrm-tabs {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.autocrm-tab {
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--ag-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.autocrm-tab.active {
    background: var(--ag-card);
    color: var(--ag-ink);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.autocrm-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

.autocrm-row.autocrm-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.autocrm-row.autocrm-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.autocrm-row.autocrm-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.autocrm-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.autocrm-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ag-muted);
}

.autocrm-input,
.autocrm-select,
.autocrm-textarea {
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 15px;
    min-height: 54px;
    line-height: 1.2;
    background: #fff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

/* Override theme defaults inside front-office */
.autocrm-front input[type="text"],
.autocrm-front input[type="email"],
.autocrm-front input[type="tel"],
.autocrm-front input[type="date"],
.autocrm-front input[type="time"],
.autocrm-front select,
.autocrm-front textarea {
    width: 100% !important;
    margin: 0 !important;
    max-width: 100% !important;
}

.autocrm-input:focus,
.autocrm-select:focus,
.autocrm-textarea:focus {
    outline: none;
    border-color: var(--ag-primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.autocrm-input:disabled,
.autocrm-select:disabled,
.autocrm-textarea:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.autocrm-search-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.autocrm-search-bar .autocrm-field {
    flex: 1 1 180px;
}

.autocrm-search-bar #ag-plate {
    min-width: 180px;
}

.autocrm-search-or {
    font-weight: 700;
    color: var(--ag-muted);
    letter-spacing: 0.06em;
    padding: 0 6px 8px;
}

.autocrm-field-action {
    min-width: 160px;
}

@media (max-width: 720px) {
    .autocrm-search-bar {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .autocrm-search-bar .autocrm-field {
        flex: 1 1 100%;
    }

    .autocrm-search-bar .autocrm-field:first-child {
        flex: 1 1 calc(100% - 44px);
        min-width: 0;
        order: 1;
    }

    .autocrm-search-or {
        order: 2;
        flex: 0 0 auto;
        padding: 0 6px;
        align-self: center;
    }

    .autocrm-search-bar .autocrm-field:nth-of-type(2) {
        order: 3;
    }

    .autocrm-search-bar .autocrm-field:nth-of-type(3) {
        order: 4;
    }

    .autocrm-search-bar .autocrm-field:nth-of-type(4) {
        order: 5;
    }

    .autocrm-search-bar .autocrm-field:nth-of-type(5) {
        order: 5;
    }

    .autocrm-search-bar .autocrm-field-action {
        order: 6;
    }

    .autocrm-search-bar {
        gap: 6px;
    }

    .autocrm-search-bar .autocrm-field {
        flex: 1 1 auto;
    }

    .autocrm-search-bar #ag-plate {
        min-width: 0;
        width: 100%;
    }

    .autocrm-search-or {
        text-align: center;
        font-size: 12px;
        letter-spacing: 0.04em;
    }

    .autocrm-field-action {
        min-width: 0;
    }

    .autocrm-field-action .autocrm-btn {
        width: 100%;
    }

    .autocrm-hero {
        padding: 12px;
        border-radius: 12px;
    }

    .autocrm-input,
    .autocrm-select,
    .autocrm-textarea {
        padding: 10px 12px;
        min-height: 42px;
        font-size: 14px;
    }
}

.autocrm-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.autocrm-btn-primary {
    background: var(--ag-primary);
    color: #fff;
}

.autocrm-btn-primary:hover {
    background: var(--ag-primary-600);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.25);
    transform: translateY(-1px);
}

.autocrm-btn-ghost {
    background: #fff;
    color: var(--ag-ink);
    border: 1px solid var(--ag-border);
}

.autocrm-btn-ghost:hover {
    background: #f1f5f9;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.autocrm-message {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    font-size: 14px;
}

.autocrm-stepper {
    position: relative;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid var(--ag-border);
    border-radius: 18px;
    padding: 20px 18px 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.autocrm-stepper-track {
    display: none;
}

.autocrm-stepper-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.autocrm-stepper-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* Pricing Tables */
.autocrm-pricing {
    padding: 20px 0;
}

.autocrm-pricing-message {
    padding: 12px 16px;
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    background: #fff;
    color: var(--ag-muted);
    font-size: 0.95rem;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    align-items: start;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 20px 16px;
    position: relative;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255,255,255,0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-card.featured {
    background: linear-gradient(135deg, #fffbf0 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(255,255,255,0.6);
}

.autocrm-front.autocrm-pricing .autocrm-pricing-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #2563eb;
    margin: 0 auto 12px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-card.featured .autocrm-pricing-icon {
    background: #fff3e0;
    color: #f59e0b;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-icon svg {
    width: 24px;
    height: 24px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--ag-ink);
}

.autocrm-front.autocrm-pricing .autocrm-pricing-desc {
    color: var(--ag-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 10px;
    justify-content: center;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-price .amount {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ag-ink);
}

.autocrm-front.autocrm-pricing .autocrm-pricing-price .suffix {
    font-size: 0.8rem;
    color: var(--ag-muted);
    text-transform: uppercase;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-save {
    background: #dcfce7;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    display: grid;
    gap: 0px;
    text-align: left;
    flex: 1 1 auto;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 0.85rem;
    line-height: 1.3;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-features i,
.autocrm-front.autocrm-pricing .autocrm-pricing-features svg {
    color: #22c55e;
    stroke: #22c55e;
    width: 18px;
    height: 18px;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 18px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    color: #2563eb;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-cta:hover {
    background: #2563eb;
    color: #fff;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-cta.featured {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.autocrm-front.autocrm-pricing .autocrm-pricing-cta.featured:hover {
    background: #d97706;
    border-color: #d97706;
}

.autocrm-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
    padding: 6px 8px;
    color: var(--ag-muted);
    font-weight: 600;
    font-size: 13px;
}

.autocrm-step.active {
    color: var(--ag-primary);
}

.autocrm-step-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    border: 2px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.autocrm-step.active .autocrm-step-icon {
    background: #fff;
    color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.autocrm-step-icon svg {
    width: 20px;
    height: 20px;
}

.autocrm-step-icon-check {
    display: none;
}

.autocrm-step.completed .autocrm-step-icon {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.autocrm-step.completed .autocrm-step-icon-main {
    display: none;
}

.autocrm-step.completed .autocrm-step-icon-check {
    display: block;
}

.autocrm-step::before {
    content: "";
    position: absolute;
    top: 24px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 999px;
    z-index: 0;
}

.autocrm-step:first-child::before {
    display: none;
}

.autocrm-step.completed::before {
    background: #22c55e;
}

.autocrm-step.active::before {
    background: #2563eb;
}

.autocrm-step-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.autocrm-step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ag-ink);
}

.autocrm-step-sub {
    font-size: 12px;
    color: var(--ag-muted);
}

.autocrm-step-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
}

.autocrm-step.completed .autocrm-step-status {
    background: #dcfce7;
    color: #16a34a;
}

.autocrm-step.active .autocrm-step-status {
    background: #e0e7ff;
    color: #2563eb;
}

.autocrm-card {
    background: var(--ag-card);
    border: 1px solid var(--ag-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.autocrm-card + .autocrm-card {
    margin-top: 8px;
}

.autocrm-service {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.autocrm-service input {
    margin-top: 4px;
}

.autocrm-service-title {
    font-weight: 700;
    font-size: 15px;
}

.autocrm-service-meta {
    font-size: 13px;
    color: var(--ag-muted);
}

.autocrm-vehicle-info {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.autocrm-vehicle-photo {
    width: 96px;
    height: 64px;
    border-radius: 12px;
    background: #f1f5f9;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autocrm-vehicle-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.autocrm-vehicle-text {
    flex: 1;
    min-width: 0;
}

.autocrm-vehicle-logo {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.autocrm-vehicle-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.autocrm-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-weight: 600;
}

.autocrm-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #cbd5f5;
    border-top-color: #2563eb;
    animation: autocrm-spin 0.9s linear infinite;
}

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

.autocrm-service-group {
    margin: 12px 0 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.autocrm-service-accordion summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.autocrm-service-accordion summary::-webkit-details-marker {
    display: none;
}

.autocrm-service-accordion[open] summary i {
    transform: rotate(180deg);
}

.autocrm-service-accordion summary i {
    transition: transform 0.2s ease;
}

.autocrm-service-group-body {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.autocrm-service-group-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 13px;
}

.autocrm-service-group-subtitle {
    color: var(--ag-muted);
    font-size: 11px;
    margin-top: 2px;
}

.autocrm-card-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    margin-bottom: 10px;
}

.autocrm-card-icon {
    width: 18px;
    height: 18px;
    color: var(--ag-primary);
}

.autocrm-inline-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    color: var(--ag-primary);
}

.autocrm-summary-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.autocrm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.autocrm-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.autocrm-choice-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.autocrm-choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autocrm-choice-body {
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--ag-ink);
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.autocrm-choice-card:hover .autocrm-choice-body {
    border-color: var(--ag-primary);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.autocrm-choice-card input:checked + .autocrm-choice-body {
    border-color: var(--ag-primary);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.autocrm-choice-icon {
    width: 18px;
    height: 18px;
    color: var(--ag-primary);
}

.autocrm-option-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.autocrm-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autocrm-option-body {
    border: 1px solid var(--ag-border);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    display: grid;
    gap: 6px;
    position: relative;
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.autocrm-option-card:hover .autocrm-option-body {
    border-color: var(--ag-primary);
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.autocrm-option-card input:checked + .autocrm-option-body {
    border-color: var(--ag-primary);
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.autocrm-option-title {
    font-weight: 700;
    color: var(--ag-ink);
}

.autocrm-option-desc {
    font-size: 13px;
    color: var(--ag-muted);
}

.autocrm-option-price {
    font-weight: 700;
    color: var(--ag-primary);
    font-size: 14px;
}

.autocrm-option-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
}

.autocrm-option-check svg {
    width: 14px;
    height: 14px;
}

.autocrm-option-card input:checked + .autocrm-option-body .autocrm-option-check {
    opacity: 1;
    transform: scale(1);
}

.autocrm-price {
    font-weight: 700;
    color: var(--ag-primary);
}

.autocrm-price.devis {
    color: var(--ag-warning);
}

.autocrm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.autocrm-garage {
    border: 1px solid var(--ag-border);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    cursor: pointer;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.autocrm-garage.selected {
    border-color: var(--ag-primary);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.15);
}

.autocrm-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.autocrm-slot {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 0;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    background: #f8fafc;
    color: var(--ag-ink);
}

.autocrm-slot:hover {
    border-color: var(--ag-primary);
}

.autocrm-slot.selected {
    background: var(--ag-primary);
    color: #fff;
    border-color: var(--ag-primary);
}

.autocrm-slot.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.autocrm-step-panel {
    display: none;
}

.autocrm-step-panel.active {
    display: block;
}

.autocrm-summary {
    display: grid;
    gap: 12px;
}

.autocrm-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.autocrm-summary-item strong {
    color: var(--ag-ink);
}

.autocrm-summary-lines {
    display: grid;
    gap: 8px;
    margin-bottom: 6px;
}

.autocrm-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--ag-ink);
}

.autocrm-summary-line strong {
    font-weight: 700;
}

.autocrm-summary-line.autocrm-muted {
    color: var(--ag-muted);
    justify-content: flex-start;
}

.autocrm-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.autocrm-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.autocrm-payment-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.autocrm-payment-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autocrm-payment-card-body {
    border: 1px solid #dbe7ff;
    border-radius: 16px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
}

.autocrm-payment-card:hover .autocrm-payment-card-body {
    border-color: #9dbbff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.autocrm-payment-card input:checked + .autocrm-payment-card-body {
    border-color: #2563eb;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
}

.autocrm-payment-title {
    font-weight: 800;
    font-size: 16px;
    color: #0f172a;
}

.autocrm-payment-desc {
    font-size: 13px;
    color: var(--ag-muted);
}

.autocrm-payment-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #e7efff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
}

.autocrm-payment-icon svg {
    width: 20px;
    height: 20px;
}

.autocrm-payment-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ag-muted);
}

.autocrm-stack {
    margin-top: 8px;
}

.autocrm-stack-sm {
    margin-top: 8px;
}

.autocrm-stack-xs {
    margin-top: 6px;
}

.autocrm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9999;
}

.autocrm-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.autocrm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.autocrm-modal-card {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    width: min(420px, 90vw);
    text-align: center;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    transform: scale(0.92);
    opacity: 0;
}

.autocrm-modal.active .autocrm-modal-card {
    animation: autocrm-modal-in 0.35s ease forwards;
}

.autocrm-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    display: grid;
    place-items: center;
}

.autocrm-modal.active .autocrm-success-icon {
    animation: autocrm-pop 0.45s ease;
}

.autocrm-success-icon svg {
    width: 48px;
    height: 48px;
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.autocrm-success-icon svg circle,
.autocrm-success-icon svg path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
}

.autocrm-modal.active .autocrm-success-icon svg circle,
.autocrm-modal.active .autocrm-success-icon svg path {
    animation: autocrm-draw 0.6s ease forwards;
}

.autocrm-modal.active .autocrm-success-icon svg path {
    animation-delay: 0.1s;
}

@keyframes autocrm-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.autocrm-modal-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.autocrm-modal-card p {
    color: var(--ag-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

@keyframes autocrm-modal-in {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes autocrm-pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .autocrm-stepper-steps {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .autocrm-step-icon {
        width: 38px;
        height: 38px;
    }

    .autocrm-step::before {
        display: none;
    }

    .autocrm-step {
        min-width: 200px;
        scroll-snap-align: center;
    }

    .autocrm-choice-grid {
        grid-template-columns: 1fr;
    }

    .autocrm-row.autocrm-row-2,
    .autocrm-row.autocrm-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Client portal */
.autocrm-portal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: auto;
    padding: 32px 16px 16px;
}

.autocrm-portal.is-guest {
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 32px 12px 18px;
    background:
        radial-gradient(420px 260px at 18% 12%, rgba(37, 99, 235, 0.22), transparent 60%),
        radial-gradient(360px 240px at 78% 18%, rgba(253, 164, 175, 0.22), transparent 60%),
        radial-gradient(320px 220px at 22% 82%, rgba(125, 211, 252, 0.20), transparent 60%),
        radial-gradient(420px 280px at 85% 78%, rgba(196, 181, 253, 0.18), transparent 60%),
        #f8fafc;
}

.autocrm-portal.is-auth {
    padding: 32px 16px 24px;
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(520px 320px at 12% 10%, rgba(37, 99, 235, 0.16), transparent 60%),
        radial-gradient(420px 280px at 86% 14%, rgba(253, 164, 175, 0.16), transparent 60%),
        radial-gradient(360px 260px at 20% 80%, rgba(94, 234, 212, 0.12), transparent 60%),
        radial-gradient(420px 300px at 85% 78%, rgba(196, 181, 253, 0.12), transparent 60%),
        #f8fafc;
}

.autocrm-portal-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--ag-border);
    background: radial-gradient(600px 200px at 10% -20%, rgba(37, 99, 235, 0.18), transparent),
                radial-gradient(500px 200px at 90% -10%, rgba(253, 164, 175, 0.18), transparent),
                var(--ag-card);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.autocrm-portal-login {
    width: min(420px, 100%);
    background: var(--ag-card);
    border: 1px solid var(--ag-border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.autocrm-portal-login-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.autocrm-portal-login-header p {
    margin: 0 0 18px;
    color: var(--ag-muted);
    font-size: 13px;
}

.autocrm-portal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autocrm-portal-form .autocrm-field {
    width: 100%;
}

.autocrm-portal-form .autocrm-input {
    width: 100%;
}

.autocrm-portal-form .autocrm-field span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ag-muted);
}

.autocrm-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.autocrm-input--with-toggle {
    padding-right: 44px;
}

.autocrm-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) !important;
    border: none;
    background: transparent;
    padding: 0;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #64748b;
    transition: none !important;
    animation: none !important;
    box-shadow: none !important;
}

.autocrm-password-toggle .autocrm-icon {
    width: 18px;
    height: 18px;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    transition: none !important;
    animation: none !important;
}

.autocrm-portal .autocrm-password-toggle:hover,
.autocrm-portal .autocrm-password-toggle:focus,
.autocrm-portal .autocrm-password-toggle:active {
    transform: translateY(-50%) !important;
    box-shadow: none !important;
    animation: none !important;
}

.autocrm-portal .autocrm-password-toggle:hover .autocrm-icon,
.autocrm-portal .autocrm-password-toggle:focus .autocrm-icon,
.autocrm-portal .autocrm-password-toggle:active .autocrm-icon {
    transform: translate(-50%, -50%) !important;
    transition: none !important;
    animation: none !important;
}

.autocrm-password-toggle .icon-hide {
    display: none;
}

.autocrm-password-toggle[aria-pressed="true"] .icon-show {
    display: none;
}

.autocrm-password-toggle[aria-pressed="true"] .icon-hide {
    display: block;
}

.autocrm-portal-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.autocrm-portal-link {
    color: var(--ag-primary);
    text-decoration: none;
    font-weight: 600;
}

.autocrm-portal-link:hover {
    text-decoration: underline;
}

.autocrm-portal-remember {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ag-muted);
}

.autocrm-portal-submit {
    width: 100%;
}

.autocrm-portal-error {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.autocrm-portal-hero h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.autocrm-portal-hero p {
    margin: 0;
    color: var(--ag-muted);
    font-size: 14px;
}

.autocrm-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.autocrm-portal-card {
    background: var(--ag-card);
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.autocrm-portal-card h3 {
    margin: 0;
    font-size: 18px;
}

.autocrm-portal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.autocrm-portal-count {
    background: #e2e8f0;
    color: #334155;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.autocrm-portal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.autocrm-portal-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--ag-border);
    background: #fff;
}

.autocrm-portal-item-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ag-ink);
}

.autocrm-portal-item-meta {
    font-size: 13px;
    color: var(--ag-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.autocrm-portal-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 130px;
}

.autocrm-portal-price {
    font-weight: 700;
    color: var(--ag-ink);
    font-size: 14px;
}

.autocrm-portal-download {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
}

.autocrm-portal-empty {
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed var(--ag-border);
    color: var(--ag-muted);
    font-size: 14px;
}

.autocrm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.autocrm-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.autocrm-badge-confirmed {
    background: #dbeafe;
    color: #1d4ed8;
}

.autocrm-badge-in-progress {
    background: #e0f2fe;
    color: #0369a1;
}

.autocrm-badge-completed {
    background: #dcfce7;
    color: #166534;
}

.autocrm-badge-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Dashboard layout */
.autocrm-portal-shell {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    align-items: start;
}

.autocrm-portal-sidebar {
    background: #fff;
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 20px;
}

.autocrm-portal-user-name {
    font-weight: 700;
    color: var(--ag-ink);
}

.autocrm-portal-user-email {
    font-size: 12px;
    color: var(--ag-muted);
}

.autocrm-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.autocrm-portal-nav-link {
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ag-ink);
    font-weight: 600;
    font-size: 14px;
    background: #f8fafc;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocrm-portal-nav-link:hover {
    border-color: var(--ag-border);
}

.autocrm-portal-nav-link.is-active {
    background: #e0edff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.autocrm-portal-logout {
    width: 100%;
}

.autocrm-portal-content {
    background: #fff;
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.autocrm-portal-top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.autocrm-portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.autocrm-portal-section-header h2 {
    margin: 0;
    font-size: 20px;
}

.autocrm-portal-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.autocrm-portal-accordion-list {
    display: none;
}

/* Global client tabs (always visible when connected) */
body.autocrm-has-client-tabs {
    padding-bottom: 86px;
}

.autocrm-global-tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--ag-border);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    z-index: 9999;
}

.autocrm-global-tab {
    flex: 1 1 0;
    text-decoration: none;
    color: var(--ag-ink);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 12px;
    background: #f8fafc;
}

.autocrm-global-tab.is-active {
    background: #e0edff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.autocrm-global-tab-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.autocrm-global-tab-icon svg {
    width: 18px;
    height: 18px;
}

.autocrm-global-tab-text {
    font-size: 11px;
    text-align: center;
}

.autocrm-portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.autocrm-portal-table th,
.autocrm-portal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.autocrm-portal-table th {
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
}

.autocrm-portal-docs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.autocrm-portal-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--ag-border);
    background: #fff;
}

.autocrm-portal-doc-title {
    font-weight: 700;
    font-size: 14px;
}

.autocrm-portal-doc-meta {
    font-size: 12px;
    color: var(--ag-muted);
}

.autocrm-portal-profile {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.autocrm-portal-grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.autocrm-portal-grid-form .full {
    grid-column: 1 / -1;
}

.autocrm-portal-success {
    background: #dcfce7;
    color: #166534;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.autocrm-portal-danger {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.autocrm-portal-danger h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #b91c1c;
}

.autocrm-portal-danger p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
}

.autocrm-portal-delete {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.autocrm-portal-delete .autocrm-input {
    min-width: 200px;
}

@media (max-width: 720px) {
    .autocrm-portal-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .autocrm-portal-item-side {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .autocrm-portal-shell {
        grid-template-columns: 1fr;
    }

    .autocrm-portal-sidebar {
        display: none;
    }

    .autocrm-portal-content {
        padding-bottom: 100px;
    }

    .autocrm-portal-table {
        min-width: 620px;
    }

    .autocrm-portal-table-desktop {
        display: none;
    }

    .autocrm-portal-accordion-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .autocrm-portal-accordion {
        border: 1px solid var(--ag-border);
        border-radius: 14px;
        background: #fff;
        padding: 0;
        overflow: hidden;
    }

    .autocrm-portal-accordion summary {
        list-style: none;
        cursor: pointer;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 700;
        font-size: 14px;
        color: var(--ag-ink);
        background: #f8fafc;
    }

    .autocrm-portal-accordion summary::-webkit-details-marker {
        display: none;
    }

    .autocrm-portal-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .autocrm-portal-card-item {
        border: 1px solid var(--ag-border);
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .autocrm-portal-card-row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        font-size: 13px;
    }

    .autocrm-portal-card-row .label {
        color: var(--ag-muted);
        font-weight: 600;
    }

    .autocrm-portal-card-row .value {
        color: var(--ag-ink);
        text-align: right;
        max-width: 60%;
    }

    .autocrm-portal-grid-form {
        grid-template-columns: 1fr;
    }
}
