/**
 * Styles for the "Add My Offer" form page.
 * Uses WordPress theme CSS variables for colors, spacing, and typography.
 */

/* Enforce Poppins font family for add-offer-form page */
body:has(.lob-add-offer-page) {
    font-family: 'Poppins', sans-serif !important;
}

/* Hide WordPress's automatically rendered page title on this page */
body:has(.lob-add-offer-page) .wp-block-post-title {
    display: none;
}

/* Remove top margin from main element on add offer page */
body:has(.lob-add-offer-page) .wp-site-blocks>main {
    margin-top: 0 !important;
    max-width: var(--wp--style--global--wide-size) !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin: auto !important;
}

/* Reduce padding on add offer page */
body:has(.lob-add-offer-page) .wp-block-group.alignfull {
    padding-top: var(--wp--preset--spacing--10/2) !important;
}

body:has(.lob-add-offer-page) .wp-site-blocks>main {
    margin-top: 0 !important;
}

#lob-form-container {
    padding: 32px 0 !important;
}

.lob-add-offer-page {
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding-bottom: 32px;
}

@media (max-width: 1024px) {
    .lob-add-offer-page {
        /*padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);*/
    }
}

@media (max-width: 768px) {
    .lob-add-offer-page {
        padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
    }
}

@media (max-width: 768px) {
    .lob-add-offer-page {
        padding: 0;
        margin: 0;
    }
}

.lob-form-header {
    margin-bottom: 32px;
}

.lob-form-header h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
    color: var(--color-gray-900);
    line-height: 36px;
}

.lob-form-header p {
    color: #4a5565;
    font-size: 16px;
    margin-top: 0;
}
.lob-form-header p:first-of-type {
    margin-bottom: 24px;
}
.lob-form-header p:last-child {
    margin-bottom: 0;
}

.lob-progress-card {
    background: var(--wp--preset--color--base);
    border: 1px solid #0000001a;
    border-radius: 1rem;
    padding: 16px 16px 24px;
    margin-bottom: 24px;
}

.lob-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Back Navigation */
.lob-back-nav {
    color: var(--color-secondary);
    font-size: 14px !important;
    font-family: "Poppins", sans-serif;
}

.lob-back-nav a {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--wp--preset--color--link-color);
    text-decoration: none;
    transition: opacity 0.2s;
    gap: 0.5rem;
    padding: 0 24px;
    margin-bottom: 24px;
}

.lob-back-nav a:hover {
    text-decoration: underline;
}

.lob-back-nav a svg {
    margin-right: 0.5rem;
    color: var(--wp--preset--color--link-color);
    height: 1rem;
    width: 1rem;
}

.lob-progress-label {
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: #364153;
    font-weight: 500;
    line-height: 1.42857;
}

.lob-progress-percent {
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: #4a5565;
    font-weight: 400;
}

.lob-progress-bar {
    width: 100%;
    height: 0.6rem;
    background: color-mix(in srgb, var(--wp--preset--color--custom-00-c-8-b-0) 20%, transparent);
    border-radius: 0.25rem;
    overflow: hidden;
}

.lob-progress-fill {
    height: 100%;
    background: var(--wp--preset--color--custom-00-c-8-b-0);
    transition: width 0.3s ease;
    width: 0%;
}

.lob-info-box {
    background: var(--wp--preset--color--base);
    border: 1px solid #0000001a;
    border-radius: 0.8rem;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #717182;
    font-family: var(--font-sans);
    font-weight: 400;
    align-items: center;
}

.lob-info-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wp--preset--color--base);
    border: 1px solid var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    /*font-weight: 700;*/
    /*font-size: var(--wp--preset--font-size--small);*/
}

.lob-info-text {
    color: #717182;
    font-size: var(--wp--preset--font-size--small);
    line-height: 1.5;
    font-family: var(--font-sans) !important;
}

.lob-form-card {
    background: var(--wp--preset--color--base);
    border: 1px solid #0000001a;
    border-radius: 1rem;
    overflow: hidden;
}

.lob-form-card-header {
    padding: 24px 24px 0;
    border-bottom: none;
}

.lob-form-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Poppins", sans-serif;
    margin-bottom: 24px;
}

.lob-tabs-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #f6f3f4;
    margin: 0 24px;
    padding: 4px;
    overflow: hidden;
    border: none;
}

.lob-tab-trigger {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--wp--preset--color--input-background);
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: #000;
    transition: all 0.2s;
    font-family: "Poppins", sans-serif;
}

/* Show tab text on large screens */
.lob-tab-trigger>span:not(.lob-tab-icon) {
    display: inline;
}

/* Hide tab text on small screens */
@media (max-width: 639px) {
    .lob-tab-trigger>span:not(.lob-tab-icon) {
        display: none;
    }
}

.lob-tab-trigger.active {
    background: color-mix(in srgb, var(--wp--preset--color--custom-00-c-8-b-0) 85%, transparent);
    color: var(--wp--preset--color--contrast);
}

.lob-tab-trigger:hover:not(.active) {
    background: color-mix(in srgb, var(--wp--preset--color--contrast) 5%, transparent);
}

.lob-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-weight: 600;
    font-size: var(--wp--preset--font-size--small);
    line-height: 1;
    flex-shrink: 0;
}

.lob-tab-content {
    display: none;
    padding: 0 24px 24px;
}

.lob-tab-content.active {
    display: block;
}

.lob-form-section-title {
    margin-top:24px;
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin-bottom: 16px;
    font-family: "Poppins", sans-serif;
}

.lob-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--wp--preset--spacing--40);
    padding-top: var(--wp--preset--spacing--40);
}

/* Button styles - ensure they work on the form page */
.lob-add-offer-page .btn-primary,
.lob-add-offer-page .btn-secondary,
.lob-add-offer-page .btn-link {
    padding: 12px 24px;
    border-radius: 0.375rem;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.lob-add-offer-page .btn-primary {
    background: var(--wp--preset--color--custom-00-c-8-b-0);
    color: var(--color-black);
    border-radius: 0;
    padding: 13px 27px;
    font-weight: 700;
    font-size: 14px;
}

.lob-add-offer-page .btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--wp--preset--color--custom-00-c-8-b-0) 85%, transparent);
}

.lob-add-offer-page .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lob-add-offer-page .btn-link {
    background: transparent;
    color: #fc792c;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    padding: 12px 24px;
    font-family: "Poppins", sans-serif;
}
.lob-add-offer-page .btn-link:hover {
    text-decoration: underline;
}

.lob-add-offer-page .btn-secondary {
    background: var(--wp--preset--color--base);
    color: var(--color-black);
    border: 1px solid var(--wp--preset--color--accent-6);
    border-radius: 0;
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lob-add-offer-page .btn-secondary:hover {
    background: var(--wp--preset--color--input-background);
}


/* Form Fields */
.lob-form-field {
    margin-bottom: 24px;
}

.lob-form-field label {
    display: block;
    font-weight: 500;
    color: #000;
    font-family: var(--font-sans);
    margin-bottom: 0 !important;
    font-size: 14px !important;
    line-height: 14px;
}

.select-label {
    margin-bottom: 12px !important;
    font-size: 16px !important;
}

.lob-form-field label .required {
    color: var(--wp--preset--color--contrast) !important;
}

.lob-form-field input[type="text"],
.lob-form-field input[type="email"],
.lob-form-field input[type="url"],
.lob-form-field input[type="tel"],
.lob-form-field input[type="number"],
.lob-form-field input[type="date"],
.lob-form-field input[type="time"],
.lob-form-field textarea,
.lob-form-field select {
    box-sizing: border-box;
    width: 100%;
    padding: 4px 12px;
    font-size: var(--wp--preset--font-size--small);
    border: none;
    border-radius: 0.375rem;
    background: #f3f3f5;
    color: var(--wp--preset--color--contrast);
    font-family: var(--font-sans);
    font-weight: 400;
    height: 36px;
}
.lob-form-field select {
    color: #717182 !important;
    font-size: 14px;
    font-weight: 700;
}

.lob-form-field select:valid {
    color: #000000 !important;
}

.lob-form-field select:focus {
    outline: none;
}

.lob-form-field select option[value=""] {
    color: #717182;
}

#doelgroep option:hover {
    background-color: #fc792c;
}

#doelgroep option:checked {
    /*background-color: #fc792c !important;*/
    /*color: #ffffff !important;*/
    font-weight: 700;
    background-image: none;
}

#doelgroep option:checked::before {
    content: "✓ ";
}


#doelgroep, #lob_focus, #planning_type, #vervoer, #kosten {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23717182' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    background-color: #f3f3f5;
    font-weight: 700;
    font-family: "Poppins", sans-serif;
}
#doelgroep option,
#lob_focus option,
#planning_type option,
#vervoer option,
#kosten option {
    background-color: #ffffff;
    color: #000;
}

#doelgroep option:focus,
#lob_focus option:focus,
#planning_type option:focus,
#vervoer option:focus,
#kosten option:focus {
    color: #ffffff;
    outline: none;
    box-shadow: none !important;
}


.lob-form-field input:focus-visible,
.lob-form-field textarea:focus-visible {
    outline: 1px solid #a1a1a1;
    border-color: #a1a1a1;
    box-shadow: 0 0 0 4px #a1a1a180;

}

input::placeholder,
textarea::placeholder {
    line-height: 1.42857;
    font-size: .875rem;
}

.lob-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.lob-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--30);
}

@media (min-width: 768px) {
    .lob-form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.lob-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    /*margin-top: var(--wp--preset--spacing--20);*/
}

.lob-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--20);
}

.lob-checkbox-item input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid #0000001a;
    border-radius: 0.25rem;
    background: #f3f3f5;
    position: relative;
    flex-shrink: 0;
    margin: 0;
}

.lob-checkbox-item input[type="checkbox"]:checked {
    background: var(--wp--preset--color--custom-00-c-8-b-0);
    border-color: var(--wp--preset--color--custom-00-c-8-b-0);
    width: 1rem !important;
    height: 1rem !important;
}

.lob-checkbox-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid var(--wp--preset--color--contrast);
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}

.lob-checkbox-item input[type="checkbox"]:hover {
    /*border-color: var(--wp--preset--color--custom-00-c-8-b-0);*/
    /*width: 1rem !important;*/
    /*height: 1rem !important;*/
}

.lob-checkbox-item label {
    margin: 0;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    cursor: pointer;
}

.lob-checkbox-group .lob-checkbox-item label {
    font-weight: 400;
    color:#364153 !important;
}

.lob-switch {
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--20);
}

.lob-switch input[type="checkbox"] {
    width: 32px;
    height: 1.25rem;
    appearance: none;
    background: #cbced4;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0 8px 0 0 !important;
}
.lob-switch svg {
    color: #f0b100 !important;
    margin-right: 8px !important;
}
.lob-switch input[type="checkbox"]:checked {
    background: var(--wp--preset--color--custom-00-c-8-b-0);
}

.lob-switch-icon {
    width: 16px;
    height: 16px;
    color: var(--wp--preset--color--yellow-500);
    flex-shrink: 0;
}

.lob-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--wp--preset--color--base);
    top: 0.125rem;
    left: 0.125rem;
    transition: transform 0.2s ease;
    transform: translateX(0);
}

.lob-switch input[type="checkbox"]:checked::before {
    transform: translateX(12px);
}


/* Cost amount fields */
.lob-cost-amount-fields {
    padding: var(--wp--preset--spacing--20);
    background: var(--wp--preset--color--input-background);
    border: 1px solid var(--wp--preset--color--accent-6);
    border-radius: 0.5rem;
}

.lob-cost-amount-label {
    display: block;
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 500;
    color: var(--wp--preset--color--contrast);
    margin-bottom: var(--wp--preset--spacing--30);
}

.lob-upload-area {
    border: 2px dashed var(--wp--preset--color--accent-6);
    border-radius: 0.5rem;
    padding: var(--wp--preset--spacing--50);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.lob-upload-area:hover {
    border-color: #a1a1a1;
}

.lob-upload-area input[type="file"] {
    display: none;
}

.lob-image-preview {
    margin-top: var(--wp--preset--spacing--30);
    position: relative;
    display: inline-block;
}

.lob-image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
}

.lob-remove-image {
    position: absolute;
    top: var(--wp--preset--spacing--20);
    right: var(--wp--preset--spacing--20);
    background: var(--wp--preset--color--custom-fc-792-c);
    color: var(--wp--preset--color--base);
    border: none;
    border-radius: 0.25rem;
    padding: var(--wp--preset--spacing--20);
    cursor: pointer;
    font-size: var(--wp--preset--font-size--small);
}

.lob-planning-info {
    padding: var(--wp--preset--spacing--30);
    background: var(--wp--preset--color--custom-dbeafe);
    border: 1px solid var(--wp--preset--color--custom-155-dfc);
    border-radius: 0.375rem;
    margin-top: var(--wp--preset--spacing--20);
}

/* Success Screen */
.lob-success-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 0 0;
    margin-top: 20px !important;
}

.lob-success-card {
    background: var(--wp--preset--color--base);
    border-radius: 1rem;
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
    max-width: 600px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    /* box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); */
    max-width: var(--wp--style--global--wide-size, 1340px);
    margin: 0 auto;
    padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
    border: 1px solid var(--color-gray-border-100);
    box-sizing: border-box;
}

.lob-success-icon {
    width: 61px;
    height: 61px;
    margin: 0 auto var(--wp--preset--spacing--40);
    color: #00c950;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.lob-success-icon svg {
    width: 61px;
    height: 61px;
}

.lob-success-title {
    font-size: var(--wp--preset--font-size--x-large);
    font-weight: 700;
    color: var(--color-gray-900) !important;
    margin-bottom: var(--wp--preset--spacing--30);
    font-size: 24px;
    /* margin-top: 0 !important; */
}

.lob-success-message {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--contrast);
    line-height: 1.6;
    margin-bottom: var(--wp--preset--spacing--30);
    font-size: 16px;
    color: var(--color-gray-600);
    font-weight: 300;
}

.lob-success-actions {
    display: flex;
    gap: var(--wp--preset--spacing--30);
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (min-width: 640px) {
    .lob-tab-trigger {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .lob-form-field {
        margin-bottom: 16px !important;
    }
    .lob-form-grid {
        gap: 0 !important;
    }
    .lob-form-field label {
        font-size: 14px;
        margin-bottom: 0;
    }
    .lob-form-actions {
        margin-top: 24px;
        padding-top: 0 !important;
    }
    .select-label {
        font-size: 16px !important;
    }
    .lob-success-card {
        padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
    }

    .lob-success-actions {
        flex-direction: column;
    }

    .lob-success-actions .btn-primary,
    .lob-success-actions .btn-secondary {
        width: 100%;
    }
}


@media (min-width: 640px) {
    body:has(.lob-add-offer-page) .wp-site-blocks>main {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (min-width: 1024px) {
    body:has(.lob-add-offer-page) .wp-site-blocks > main {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

}
