/*-----------------------------------------------------------------------------------
    Premier Metals — native form styles (pm- prefix)
    Used by: contact.html, visualizer.html, post-frame.html, application.html
    Depends on: assets/css/style.css (loaded first), Lexend Deca webfont
-----------------------------------------------------------------------------------*/

/*----------------------------------------
    Form layout
----------------------------------------*/

.pm-form-wrap {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
}

.pm-form {
    width: 100%;
    text-align: left;
}

.pm-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.pm-field {
    flex: 1 1 260px;
    min-width: 0;
    padding: 0 10px;
    margin-bottom: 22px;
}

.pm-field--full {
    flex-basis: 100%;
}

.pm-field label {
    display: block;
    font-family: 'Lexend Deca', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #000;
    margin-bottom: 7px;
}

.pm-req {
    color: #590a0a;
}

/*----------------------------------------
    Inputs
----------------------------------------*/

.pm-field input[type="text"],
.pm-field input[type="email"],
.pm-field input[type="tel"],
.pm-field input[type="date"],
.pm-field input[type="number"],
.pm-field select,
.pm-field textarea {
    display: block;
    width: 100%;
    padding: 11px 16px;
    font-size: 16px;
    line-height: 1.5;
    color: #3b3b3b;
    background-color: #fff;
    border: solid 2px #d9d9d9;
    border-radius: 8px;
    -webkit-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -o-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.pm-field select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%233b3b3b' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.pm-field textarea {
    min-height: 150px;
    resize: vertical;
}

.pm-field input::placeholder,
.pm-field textarea::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus {
    outline: none;
    border-color: #590a0a;
    box-shadow: 0 0 0 3px rgba(89, 10, 10, 0.12);
}

/* checkbox rows (used by application form) */
.pm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pm-check input[type="checkbox"],
.pm-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex: none;
    accent-color: #590a0a;
}

.pm-check label {
    margin-bottom: 0;
    font-family: inherit;
    font-weight: 400;
    font-size: 16px;
    color: #3b3b3b;
}

/*----------------------------------------
    Validation errors
----------------------------------------*/

.pm-field input.pm-invalid,
.pm-field select.pm-invalid,
.pm-field textarea.pm-invalid {
    border-color: #781113;
}

.pm-field input.pm-invalid:focus,
.pm-field select.pm-invalid:focus,
.pm-field textarea.pm-invalid:focus {
    box-shadow: 0 0 0 3px rgba(120, 17, 19, 0.12);
}

.pm-field-error {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #781113;
}

.pm-field-error:empty {
    display: none;
}

/* Turnstile widget sits in its own full-width row above the submit button */
.pm-turnstile-field {
    margin-bottom: 12px;
}

.pm-turnstile-field .pm-turnstile {
    min-height: 65px; /* reserve the managed widget's height so the layout doesn't jump */
}

.pm-form-error {
    margin-bottom: 22px;
    padding: 12px 16px;
    border: solid 2px #781113;
    border-radius: 8px;
    font-size: 15px;
    color: #781113;
    background-color: rgba(120, 17, 19, 0.05);
}

/*----------------------------------------
    Honeypot — visually removed, still in the DOM
    (off-screen, NOT display:none)
----------------------------------------*/

.pm-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/*----------------------------------------
    Submit button — mirrors the site's #black-button
----------------------------------------*/

.pm-actions {
    padding: 0 10px;
}

.pm-btn {
    display: inline-block;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    padding: 9px 40px;
    color: #3b3b3b;
    background-color: transparent;
    border: solid 2px #000;
    border-radius: 40px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease, border-color 0.2s ease;
    -o-transition: background-color 0.2s ease, border-color 0.2s ease;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pm-btn:hover {
    border-color: #ededed;
    background-color: #ededed;
}

.pm-btn:focus-visible {
    outline: none;
    border-color: #590a0a;
    box-shadow: 0 0 0 3px rgba(89, 10, 10, 0.2);
}

.pm-btn i {
    margin-left: 8px;
}

/* sending state */
.pm-btn:disabled,
.pm-btn.pm-sending {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/*----------------------------------------
    Modal (staff contact popup — in-page dialog, never a new window)
----------------------------------------*/

.pm-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pm-modal[hidden] {
    display: none;
}

.pm-modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.55);
    border: 0;
    padding: 0;
    cursor: pointer;
    animation: pm-fade 0.2s ease-out;
}

.pm-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    margin: auto 0;
    background-color: #fff;
    border-radius: 11px;
    padding: 36px 32px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: left;
    animation: pm-rise 0.25s ease-out;
}

@keyframes pm-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pm-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pm-modal-title {
    font-family: 'Lexend Deca', sans-serif;
    font-weight: 500;
    font-size: 24px;
    color: #000;
    margin: 0 0 6px;
    padding: 0 36px 0 0;
    text-align: left;
}

.pm-modal-intro {
    margin: 0 0 24px;
    font-size: 16px;
    color: #3b3b3b;
    text-align: left;
    padding: 0;
}

/* body scroll lock while the modal is open */
body.pm-modal-open {
    overflow: hidden;
}

.pm-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #3b3b3b;
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.pm-modal-close:hover {
    background-color: #ededed;
}

.pm-modal-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(89, 10, 10, 0.2);
}

/*----------------------------------------
    Page-level helpers
----------------------------------------*/

/* section wrapper for a standalone form (quote / application pages) */
.pm-form-section {
    float: left;
    width: 100%;
    padding: 4% 0;
}

/* fieldset-style grouping with a Lexend Deca heading (application form) */
.pm-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 10px;
    min-width: 0;
}

.pm-fieldset legend,
.pm-form-heading {
    font-family: 'Lexend Deca', sans-serif;
    font-weight: 500;
    font-size: 20px;
    color: #000;
    padding: 0;
    margin-bottom: 18px;
    border-bottom: solid 3px #e6e6e6;
    width: 100%;
    padding-bottom: 8px;
}

/* collapsible sections (application form): native <details> styled like site cards */
.pm-collapse {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    margin: 0 0 14px;
}

.pm-collapse summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-family: 'Lexend Deca', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #000;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.pm-collapse summary::-webkit-details-marker {
    display: none;
}

/* the required asterisk is its own flex item — keep it beside the heading,
   and let it push the chevron to the far right */
.pm-collapse summary .pm-req {
    margin-left: -6px;
    margin-right: auto;
}

.pm-collapse summary::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 2px;
    border-right: 2px solid #590a0a;
    border-bottom: 2px solid #590a0a;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.pm-collapse[open] summary::after {
    transform: rotate(-135deg);
}

.pm-collapse summary:hover {
    color: #590a0a;
}

.pm-collapse[open] summary {
    border-bottom: 1px solid #e6e6e6;
    margin-bottom: 16px;
}

.pm-collapse .pm-fieldset {
    padding: 0 18px;
    margin: 0 0 8px;
}

/*----------------------------------------
    Responsive
----------------------------------------*/

@media only screen and (max-width: 575px) {
    .pm-field {
        flex-basis: 100%;
    }

    .pm-modal {
        padding: 12px;
    }

    .pm-modal-card {
        padding: 28px 20px 24px;
    }

    .pm-btn {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-field input,
    .pm-field select,
    .pm-field textarea,
    .pm-btn,
    .pm-modal-close {
        transition: none;
    }

    .pm-modal-overlay,
    .pm-modal-card {
        animation: none;
    }
}
