/* Shared modal styles used by the homepage and all secondary pages. */

.case-modal {
    padding: clamp(12px, 3vw, 32px);
    overflow: hidden;
    background: rgba(2, 6, 23, 0.76);
}

.case-modal-content {
    max-width: 1120px;
    max-height: calc(100dvh - 40px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    transform: translateY(24px) scale(0.96);
    transform-origin: center;
    scrollbar-width: thin;
}

.case-modal.active .case-modal-content { transform: translateY(0) scale(1); }

.case-modal-close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.case-gallery-modal-content { max-width: 1180px; }
.case-gallery-modal-content .case-layout { grid-template-columns: 1.45fr 0.85fr; }
.case-gallery-modal-content .case-gallery { padding: 20px; }
.case-gallery-modal-content .case-main-img-box { margin-bottom: 14px; aspect-ratio: 16 / 9; }
.case-gallery-modal-content .case-info { padding: 38px 34px 30px; }
.case-gallery-modal-content .case-info h3 { font-size: clamp(1.65rem, 2.4vw, 2.15rem); }
.case-gallery-modal-content .case-meta,
.case-gallery-modal-content .case-divider { margin-bottom: 16px; }
.case-gallery-modal-content .case-info p { font-size: 1rem; line-height: 1.6; }
.case-gallery-modal-content .case-order-btn { margin-top: 24px; }

.order-modal-content {
    width: min(920px, calc(100vw - 40px));
    max-width: 920px;
    overflow-x: hidden;
    overflow-y: auto;
}

.order-modal-form {
    display: grid;
    align-content: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
    margin: 0;
    padding: 26px 30px 24px;
    overflow: visible;
    background: #fff;
}

.order-modal-form .field-wrap {
    min-width: 0;
    gap: 4px;
}

.order-modal-form > .form-label {
    grid-column: 1 / -1;
    margin-bottom: -5px;
}

.order-modal-form .form-label {
    margin: 0 0 3px 2px;
    font-size: 0.76rem;
    line-height: 1.2;
}

.order-modal-form .field-error {
    min-height: 0;
    margin: 0;
    padding-left: 2px;
    font-size: 0.7rem;
    line-height: 1.2;
}

.order-modal-form .contact-input-wizard {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #d7dee8;
    border-radius: 13px;
    color: var(--text-main);
    background: #fff;
    font-size: 0.91rem;
    line-height: 1.25;
}

.order-modal-form .contact-input-wizard::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.order-modal-form .contact-input-wizard:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.13);
}

.order-modal-form textarea {
    min-height: 66px;
    max-height: 110px;
    resize: vertical;
    font-family: inherit;
}

.order-modal-submit {
    min-height: 42px;
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.2);
    font-size: 0.94rem;
}

.order-modal-form .form-status {
    margin-top: 0;
    padding: 9px 11px;
    font-size: 0.78rem;
}

.order-modal-layout { display: grid; grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr); }

.order-modal-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 34px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.34), transparent 40%),
        linear-gradient(145deg, #0f172a, #12375a);
}

.order-modal-icon,
.legal-modal-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.26);
}

.order-modal-intro h3 { margin-bottom: 10px; color: #fff; font-size: 1.8rem; line-height: 1.15; }
.order-modal-intro p { margin-bottom: 24px; color: #cbd5e1; font-size: 0.94rem; line-height: 1.6; }
.order-modal-benefits { display: flex; flex-direction: column; gap: 10px; }
.order-modal-benefits span { display: flex; align-items: center; gap: 9px; color: #e2e8f0; font-size: 0.86rem; font-weight: 700; }
.order-modal-benefits i { color: #67e8f9; }

.order-modal-form .modal-schedule-grid,
.order-modal-form textarea,
.order-modal-form .order-modal-submit,
.order-modal-form .form-status { grid-column: 1 / -1; }
.order-modal-form .contact-input-wizard { padding: 13px 14px; font-size: 0.94rem; }
.order-modal-form textarea { min-height: 72px; resize: vertical; font-family: inherit; }

.order-modal-submit,
.legal-accept-btn {
    width: 100%;
    padding: 14px 18px;
    border: 0;
    background: linear-gradient(135deg, var(--accent), #059669);
    font-size: 1rem;
}

.legal-modal-content { width: min(1060px, 100%); max-width: 1060px; padding: 28px 32px 26px; }
.legal-modal-header { display: flex; align-items: center; gap: 16px; padding-right: 48px; }
.legal-modal-icon { flex: 0 0 52px; margin: 0; }
.legal-modal-header h3 { margin-bottom: 4px; color: var(--dark); font-size: 1.65rem; }
.legal-modal-header p { color: var(--text-light); font-size: 0.9rem; }

.legal-modal-content .legal-text-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 48dvh;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
}

.legal-clause { padding: 13px 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.legal-text-container .legal-clause h4 { margin: 0 0 5px; font-size: 0.92rem; }
.legal-text-container .legal-clause p { margin: 0; font-size: 0.82rem; line-height: 1.48; }
.legal-accept-btn { display: flex; width: fit-content; margin-left: auto; }

@media (max-width: 720px) {
    .case-modal { align-items: center; padding: 8px; }
    .case-modal-content { max-height: calc(100dvh - 16px); border-radius: 22px; margin: 2%; }
    .case-modal-close { top: 10px; right: 10px; width: 38px; height: 38px; }
    .case-gallery-modal-content .case-layout { grid-template-columns: 1fr; }
    .case-gallery-modal-content .case-gallery { padding: 12px; }
    .case-gallery-modal-content .case-main-img-box { margin-bottom: 10px; }
    .case-gallery-modal-content .case-info { padding: 22px 18px 20px; }
    .case-gallery-modal-content .case-info h3 { padding-right: 34px; }
    .order-modal-layout { grid-template-columns: 1fr; }
    .order-modal-intro { padding: 20px 18px 15px; }
    .order-modal-icon { width: 40px; height: 40px; margin-bottom: 9px; border-radius: 12px; }
    .order-modal-intro h3 { padding-right: 34px; font-size: 1.35rem; }
    .order-modal-intro p { margin-bottom: 10px; font-size: 0.82rem; line-height: 1.45; }
    .order-modal-benefits { flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
    .order-modal-benefits span { font-size: 0.75rem; }
    .order-modal-form { grid-template-columns: 1fr; gap: 9px; padding: 16px 14px 17px; }
    .order-modal-form .contact-input-wizard { padding: 10px 12px; font-size: 0.87rem; border-radius: 12px; }
    .order-modal-form textarea { min-height: 58px; max-height: 86px; }
    .order-modal-submit { min-height: 40px; padding: 11px 14px; font-size: 0.88rem; }
    .order-modal-form .modal-schedule-grid { grid-template-columns: 1fr 1fr; display: none; }
    .legal-modal-content { padding: 20px 16px 16px; }
    .legal-modal-header { gap: 11px; padding-right: 38px; }
    .legal-modal-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
    .legal-modal-header h3 { font-size: 1.25rem; }
    .legal-modal-header p { font-size: 0.8rem; line-height: 1.35; }
    .legal-modal-content .legal-text-container { grid-template-columns: 1fr; max-height: 50dvh; margin: 12px 0; padding: 9px; }
    .legal-accept-btn { width: 100%; margin: 0; justify-content: center; font-size: 0.88rem; }
}

@media (max-width: 420px) {
    .order-modal-form .modal-schedule-grid { grid-template-columns: 1fr; }
    .order-modal-benefits span { font-size: 0.78rem; }
}
