/* ============================================================
   MODAL.CSS — Sample Request Modal
   Uses the same design tokens as style.css:
     --primary-brown: #44362d
     --bg-light:      #f9f6f3
     --bg-accent:     #F4F1EC
     --font-heading:  'Montserrat', sans-serif
     --font-body:     'Inter', sans-serif
   ============================================================ */

/* --- Overlay --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(28, 22, 18, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.is-open {
    display: flex;
}

/* --- Card --- */
.modal-card {
    background: var(--bg-light);
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(68, 54, 45, 0.15);

    /* Entrance animation */
    animation: modalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header --- */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 36px 36px 24px;
    border-bottom: 1px solid rgba(68, 54, 45, 0.12);
}

.modal-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(68, 54, 45, 0.5);
    margin-bottom: 8px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-brown);
    margin: 0 0 8px;
    line-height: 1.2;
}

.modal-subtitle {
    font-family: var(--font-body);
    font-size: 14px;
    color: rgba(68, 54, 45, 0.65);
    line-height: 1.55;
    margin: 0;
}

.modal-close {
    background: none;
    border: 1px solid rgba(68, 54, 45, 0.2);
    color: var(--primary-brown);
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.modal-close:hover {
    background: var(--primary-brown);
    color: #fff;
    border-color: var(--primary-brown);
}

/* --- Body (form fields) --- */
.modal-body {
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-label {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(68, 54, 45, 0.6);
    font-weight: 500;
}

.modal-input {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--primary-brown);
    background: #FDFCFA;
    border: 1px solid rgba(68, 54, 45, 0.22);
    padding: 12px 14px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    /* Matches site's zero-border-radius aesthetic */
    border-radius: 0;
}

.modal-input::placeholder {
    color: rgba(68, 54, 45, 0.35);
}

.modal-input:focus {
    border-color: var(--primary-brown);
    box-shadow: 0 0 0 3px rgba(68, 54, 45, 0.08);
}

.modal-textarea {
    resize: vertical;
    min-height: 90px;
}

/* --- Error / Success --- */
.modal-error,
.modal-success {
    display: none;
    font-family: var(--font-body);
    font-size: 13px;
    padding: 12px 14px;
    line-height: 1.5;
}

.modal-error {
    background: #FDF0EE;
    border: 1px solid rgba(180, 60, 30, 0.3);
    color: #8B2500;
}

.modal-success {
    background: #EEF5E8;
    border: 1px solid rgba(60, 120, 40, 0.3);
    color: #2E5A1C;
}

/* --- Footer --- */
.modal-footer {
    padding: 0 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Inherit .btn-primary from style.css — just set width */
.modal-submit {
    width: 100%;
    font-family: var(--font-body);
    letter-spacing: 0.06em;
}

/* Loading state */
.modal-submit.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-note {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(68, 54, 45, 0.45);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* --- Prevent body scroll when modal is open --- */
body.modal-open {
    overflow: hidden;
}

/* --- Mobile --- */
@media screen and (max-width: 600px) {
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .modal-title {
        font-size: 22px;
    }
}