/* ==========================================================================
   Deal Maker — Modal & Chat Styles (Light Theme)
   ========================================================================== */

/* ---- Overlay ---- */
.dm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dm-overlay.dm-open {
    opacity: 1;
    visibility: visible;
}

/* ---- Modal ---- */
.dm-modal {
    width: 95%;
    max-width: 640px;
    max-height: 85vh;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
}

.dm-overlay.dm-open .dm-modal {
    transform: translateY(0) scale(1);
}

/* ---- Header ---- */
.dm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #46659B, #3a5687);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dm-avatar-icon {
    width: 20px;
    height: 20px;
    color: #fff;
}

.dm-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.dm-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.3;
}

/* Header action buttons (returning users) */
.dm-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}

.dm-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.dm-header-btn svg {
    flex-shrink: 0;
}

.dm-header-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.dm-header-btn-primary {
    background: #46659B;
    color: #fff;
    border-color: #46659B;
}

.dm-header-btn-primary:hover {
    background: #3a5687;
    border-color: #3a5687;
}

.dm-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.dm-close svg {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.dm-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ---- Chat body ---- */
.dm-chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: 50vh;
    scroll-behavior: smooth;
}

/* Scrollbar */
.dm-chat::-webkit-scrollbar {
    width: 5px;
}

.dm-chat::-webkit-scrollbar-track {
    background: transparent;
}

.dm-chat::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* ---- Messages ---- */
.dm-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    animation: dm-fade-in 0.3s ease;
}

.dm-message-assistant {
    align-self: flex-start;
    background: #f1f5f9;
    color: #334155;
    border-bottom-left-radius: 4px;
}

.dm-message-user {
    align-self: flex-end;
    background: #46659B;
    color: #fff;
    border-bottom-right-radius: 4px;
}

@keyframes dm-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Typing indicator ---- */
.dm-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    animation: dm-fade-in 0.3s ease;
}

.dm-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: dm-bounce 1.4s ease-in-out infinite;
}

.dm-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dm-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dm-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* ---- Quick replies ---- */
.dm-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 12px;
    min-height: 0;
}

.dm-quick-replies:empty {
    display: none;
}

.dm-quick-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #46659B;
    background: rgba(70, 101, 155, 0.06);
    border: 1px solid rgba(70, 101, 155, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.dm-quick-btn:hover {
    background: rgba(70, 101, 155, 0.12);
    border-color: rgba(70, 101, 155, 0.35);
}

/* ---- Input area ---- */
.dm-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dm-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.dm-input::placeholder {
    color: #94a3b8;
}

.dm-input:focus {
    border-color: rgba(70, 101, 155, 0.5);
}

.dm-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #46659B;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.dm-send svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.dm-send:hover {
    background: #3a5687;
}

.dm-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Scope Summary Card ---- */
.dm-scope-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid rgba(70, 101, 155, 0.15);
    border-radius: 12px;
    padding: 16px;
    animation: dm-fade-in 0.4s ease;
    align-self: flex-start;
    max-width: 95%;
}

.dm-scope-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}

.dm-scope-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.dm-scope-badge.high {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.dm-scope-badge.medium {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.dm-scope-badge.low {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.dm-scope-summary {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* Phase list */
.dm-phases {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dm-phase {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dm-phase-marker {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(70, 101, 155, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #46659B;
}

.dm-phase-info {
    flex: 1;
}

.dm-phase-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.dm-phase-meta {
    font-size: 12px;
    color: #64748b;
}

/* Pricing display */
.dm-scope-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(70, 101, 155, 0.08), rgba(53, 80, 122, 0.04));
    border: 1px solid rgba(70, 101, 155, 0.15);
    border-radius: 10px;
    margin-bottom: 14px;
}

.dm-scope-price-label {
    font-size: 13px;
    color: #64748b;
}

.dm-scope-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #46659B;
    letter-spacing: -0.01em;
}

.dm-phase-cost {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
}

.dm-scope-note {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 14px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid rgba(70, 101, 155, 0.2);
    border-radius: 0 6px 6px 0;
}

.dm-scope-type {
    font-size: 12px;
    color: #46659B;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: -4px 0 10px;
}

.dm-scope-modules {
    margin: 0 0 14px;
}
.dm-scope-modules h5 {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}
.dm-scope-modules ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dm-scope-modules li {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}
.dm-module-hours {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}
.dm-module-desc {
    font-size: 12px;
    color: #64748b;
}

.dm-scope-assumptions {
    margin: 0 0 14px;
}
.dm-scope-assumptions h5 {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
}
.dm-scope-assumptions ul {
    list-style: disc;
    padding-left: 18px;
    margin: 0;
}
.dm-scope-assumptions li {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 2px;
}

.dm-scope-next-step {
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: rgba(70, 101, 155, 0.06);
    border-radius: 8px;
    border-left: 3px solid #46659B;
}

.dm-scope-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(70, 101, 155, 0.06);
    border-radius: 8px;
    margin-bottom: 14px;
}

.dm-scope-total-label {
    font-size: 13px;
    color: #64748b;
}

.dm-scope-total-value {
    font-size: 18px;
    font-weight: 700;
    color: #46659B;
}

/* Book a Call CTA */
.dm-book-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #46659B, #3a5687);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dm-book-btn:hover {
    opacity: 0.9;
}

.dm-book-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Intro / Contact Form (Step 1)
   ========================================================================== */

.dm-intro {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

.dm-intro::-webkit-scrollbar {
    width: 5px;
}

.dm-intro::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
}

.dm-intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dm-intro-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(70, 101, 155, 0.12), rgba(53, 80, 122, 0.12));
    border: 1px solid rgba(70, 101, 155, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.dm-intro-icon svg {
    width: 24px;
    height: 24px;
    color: #46659B;
}

.dm-intro-heading {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
    text-align: center;
}

.dm-intro-text {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.55;
    margin: 0 0 24px;
    max-width: 380px;
}

/* Honeypot — visually hidden but accessible to bots */
.dm-hp-wrap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* Form */
.dm-intro-form {
    width: 100%;
}

.dm-form-group {
    margin-bottom: 14px;
}

.dm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.dm-required {
    color: #ef4444;
}

.dm-field {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.dm-field::placeholder {
    color: #94a3b8;
}

.dm-field:focus {
    border-color: rgba(70, 101, 155, 0.5);
}

.dm-field.dm-field-error {
    border-color: rgba(239, 68, 68, 0.5);
}

/* NDA Section */
.dm-nda-section {
    background: rgba(70, 101, 155, 0.04);
    border: 1px solid rgba(70, 101, 155, 0.1);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    margin-top: 6px;
}

.dm-nda-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.dm-nda-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dm-nda-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #e2e8f0;
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dm-nda-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #94a3b8;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.dm-nda-checkbox:checked + .dm-nda-switch {
    background: rgba(70, 101, 155, 0.2);
}

.dm-nda-checkbox:checked + .dm-nda-switch::after {
    transform: translateX(18px);
    background: #46659B;
}

.dm-nda-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.dm-nda-hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin: 10px 0 0;
}

/* Error */
.dm-intro-error {
    font-size: 13px;
    color: #ef4444;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 8px;
    margin-bottom: 14px;
}

/* Start button */
.dm-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #46659B, #3a5687);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.dm-start-btn:hover {
    opacity: 0.9;
}

.dm-start-btn:active {
    transform: scale(0.98);
}

.dm-start-btn svg {
    width: 18px;
    height: 18px;
}

/* Chat wrapper (step 2) */
.dm-chat-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .dm-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .dm-chat {
        max-height: calc(100vh - 200px);
    }

    .dm-intro {
        padding: 20px 16px;
    }

    .dm-header-actions {
        gap: 4px;
        margin-right: 6px;
    }

    .dm-header-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}
