/* Contact Modal */
.cm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cm-overlay.open {
    display: flex;
}

.cm-modal {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: cmSlideIn 0.25s ease;
}
@keyframes cmSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cm-close:hover { background: #e2e8f0; }

.cm-header { margin-bottom: 20px; }
.cm-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}
.cm-subtitle {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
}

.cm-field { margin-bottom: 14px; }
.cm-label {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

/* Inputs & Textarea */
.cm-field input[type="text"],
.cm-field input[type="tel"],
.cm-field input[type="email"],
.cm-field textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
    resize: none;
}
.cm-field input:focus,
.cm-field textarea:focus {
    border-color: var(--accent-color);
}
.cm-field input::placeholder,
.cm-field textarea::placeholder {
    color: #94a3b8;
}

/* Tabs */
.cm-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.cm-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    color: #475569;
    transition: border-color 0.2s, color 0.2s;
}
.cm-tab:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.cm-tab.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light, #FFE8E7);
}

/* Phone field with prefix */
.cm-phone-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.cm-phone-wrap:focus-within { border-color: var(--accent-color); }
.cm-phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: #0f172a;
    border-right: 1.5px solid #e2e8f0;
    white-space: nowrap;
    flex-shrink: 0;
    height: 100%;
    min-height: 46px;
}
.cm-phone-wrap input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    min-width: 0;
}
.cm-phone-wrap input:focus { border: none; }

/* Consent */
.cm-consent { margin-bottom: 16px; }
.cm-checkbox-label {
    display: flex;
    gap: 10px;
    cursor: pointer;
    align-items: flex-start;
}
.cm-checkbox-label input[type="checkbox"] { display: none; }
.cm-checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    margin-top: 1px;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm-checkbox-label input:checked + .cm-checkbox-custom {
    background: var(--accent-color);
    border-color: var(--accent-color);
}
.cm-checkbox-label input:checked + .cm-checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    margin-top: -2px;
}
.cm-consent-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
.cm-consent-text a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Error */
.cm-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Submit */
.cm-submit {
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.cm-submit:hover { opacity: 0.9; }
.cm-submit:active { transform: scale(0.99); }
.cm-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success state */
.cm-success {
    text-align: center;
    padding: 24px 0;
}
.cm-success-icon {
    width: 60px;
    height: 60px;
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #22c55e;
    margin: 0 auto 16px;
}
.cm-success h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.cm-success p {
    color: #475569;
    font-size: 14px;
}

@media (max-width: 480px) {
    .cm-modal { padding: 24px 20px; }
    .cm-tabs { grid-template-columns: repeat(2, 1fr); }
}
