/* Allianz Direct inspired form styles with shadcn/ui components */

:root {
    --allianz-blue: #003DA5;
    --allianz-blue-light: #0052CC;
    --allianz-blue-dark: #002D7A;
    --allianz-gray: #F5F5F5;
    --allianz-gray-dark: #666666;
    --allianz-border: #E0E0E0;
    --allianz-error: #D32F2F;
    --allianz-success: #2E7D32;
}

.form-section {
    padding: 4rem 0;
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--allianz-blue);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--allianz-gray-dark);
    font-size: 1rem;
}

/* Verdiepingsvragen: secties per dekking */
.verdiepings-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.verdiepings-section {
    padding: 1rem 0;
    border-bottom: 1px solid var(--allianz-border);
}
.verdiepings-section:last-of-type {
    border-bottom: none;
}
.verdiepings-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--allianz-blue-dark);
    margin-bottom: 0.75rem;
}

/* Boolean schuif voor verdiepingsvragen */
.boolean-switch {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.boolean-switch .slider {
    position: relative;
    width: 42px;
    height: 22px;
    background: #cde3ff; /* lichte (disabled) blauw bij Nee */
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.boolean-switch .slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
    transition: transform 0.2s ease;
}

.boolean-switch input[type="checkbox"] {
    display: none;
}

.boolean-switch input[type="checkbox"]:checked + .slider {
    background: var(--allianz-blue); /* helder blauw bij Ja */
}

.boolean-switch input[type="checkbox"]:checked + .slider::before {
    transform: translateX(20px);
}

.boolean-switch .switch-text {
    font-size: 0.85rem;
    color: var(--allianz-gray-dark);
    white-space: nowrap;
}

.boolean-switch input[type="checkbox"]:checked + .slider + .switch-text {
    color: var(--allianz-blue);
}

/* Shadcn Form Styles */
.shadcn-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    column-gap: 2rem;
}

/* Full width fields (span both columns) */
.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Boolean velden: schuif links, tekst rechts in één regel */
.form-field.boolean-field {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    column-gap: 2rem; /* extra ruimte tussen switch en vraag */
}

.form-field.boolean-field .form-label {
    flex: 1;
}

/* Inline form fields for address row */
.address-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.form-field-inline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

/* Flex values for inline fields in address row */
.address-row .form-field-inline:first-child {
    flex: 1.2;
}

.address-row .form-field-inline:last-child {
    flex: 0.8;
}

/* Special handling for toevoeging field in address row */
.address-row .toevoeging-field {
    flex: 1.8;
    min-width: 280px;
}

/* Same width for postcode and geboortedatum fields */
.postcode-width {
    flex: 0 0 auto;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

/* Toevoeging field - needs more space for button */
.toevoeging-field {
    flex: 1.5;
    min-width: 0;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.required {
    color: var(--allianz-error);
}

.input-wrapper {
    position: relative;
}

/* Shadcn Input */
.shadcn-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--white);
    border: 1.5px solid var(--allianz-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}

/* Geboortedatum: leeg = lichtgrijs als placeholder; ingevuld = normale tekstkleur */
.shadcn-input[type="date"]:invalid {
    color: var(--input-muted, #94a3b8);
    -webkit-text-fill-color: var(--input-muted, #94a3b8);
}

.shadcn-input[type="date"]:invalid::-webkit-datetime-edit,
.shadcn-input[type="date"]:invalid::-webkit-datetime-edit-fields-wrapper,
.shadcn-input[type="date"]:invalid::-webkit-datetime-edit-text,
.shadcn-input[type="date"]:invalid::-webkit-datetime-edit-month-field,
.shadcn-input[type="date"]:invalid::-webkit-datetime-edit-day-field,
.shadcn-input[type="date"]:invalid::-webkit-datetime-edit-year-field {
    font-family: inherit;
    color: var(--input-muted, #94a3b8);
    -webkit-text-fill-color: var(--input-muted, #94a3b8);
}

.shadcn-input[type="date"]:valid {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.shadcn-input[type="date"]:valid::-webkit-datetime-edit,
.shadcn-input[type="date"]:valid::-webkit-datetime-edit-fields-wrapper,
.shadcn-input[type="date"]:valid::-webkit-datetime-edit-text,
.shadcn-input[type="date"]:valid::-webkit-datetime-edit-month-field,
.shadcn-input[type="date"]:valid::-webkit-datetime-edit-day-field,
.shadcn-input[type="date"]:valid::-webkit-datetime-edit-year-field {
    font-family: inherit;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.shadcn-input::placeholder {
    color: #9CA3AF;
}

.shadcn-input:hover {
    border-color: var(--allianz-blue-light);
}

.shadcn-input:focus {
    border-color: var(--allianz-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.shadcn-input:invalid:not(:placeholder-shown) {
    border-color: var(--allianz-error);
}

.shadcn-input:valid:not(:placeholder-shown) {
    border-color: var(--allianz-success);
}

/* Shadcn Select */
.shadcn-select {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--white);
    border: 1.5px solid var(--allianz-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23003DA5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Smaller select for specific fields */
#schadevrije-jaren {
    max-width: 200px;
}

.shadcn-select:hover {
    border-color: var(--allianz-blue-light);
}

.shadcn-select:focus {
    border-color: var(--allianz-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.shadcn-select:invalid {
    border-color: var(--allianz-border);
}

.shadcn-select:valid:not([value=""]) {
    border-color: var(--allianz-success);
}

.shadcn-select option {
    padding: 0.5rem;
    color: var(--text);
}

.shadcn-select option:disabled {
    color: #9CA3AF;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--allianz-gray-dark);
    margin-top: 0.25rem;
}

.error-message {
    color: var(--allianz-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠";
    font-size: 1rem;
}

/* Radio Group (Shadcn style) */
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: var(--allianz-gray);
}

.shadcn-radio {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--allianz-blue);
    border: 2px solid var(--allianz-border);
    border-radius: 50%;
    appearance: none;
    position: relative;
    transition: all 0.2s ease;
}

.shadcn-radio:checked {
    border-color: var(--allianz-blue);
    background-color: var(--white);
}

.shadcn-radio:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background-color: var(--allianz-blue);
}

.shadcn-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.radio-option span {
    font-size: 1rem;
    color: var(--text);
    user-select: none;
}

/* Shadcn Button */
.shadcn-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    text-decoration: none;
}

.shadcn-button-primary {
    background-color: var(--allianz-blue);
    color: var(--white);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadcn-button-primary:hover {
    background-color: var(--allianz-blue-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.shadcn-button-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadcn-button-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.2);
}

.shadcn-button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.shadcn-button-secondary {
    background-color: var(--white);
    color: var(--allianz-blue);
    border: 1.5px solid var(--allianz-blue);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.shadcn-button-secondary:hover {
    background-color: var(--allianz-gray);
    border-color: var(--allianz-blue-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.shadcn-button-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadcn-button-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.2);
}

.shadcn-button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Kenteken wrapper for input + button */
.kenteken-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.kenteken-wrapper .input-wrapper {
    flex: 1;
}

.kenteken-wrapper .shadcn-button {
    margin-top: 0;
    align-self: flex-start;
}

/* Toevoeging wrapper for input + button */
.toevoeging-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.toevoeging-wrapper .input-wrapper {
    flex: 0 0 auto;
    min-width: 0;
}

.toevoeging-wrapper .input-wrapper.postcode-width {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.toevoeging-wrapper .shadcn-button {
    margin-top: 0;
    align-self: flex-start;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.form-actions.full-width {
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    .form-section {
        padding: 2rem 0;
    }

    .form-container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .shadcn-form {
        padding: 1.5rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-field.full-width {
        grid-column: 1;
    }

    .form-header h2 {
        font-size: 1.5rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions.full-width {
        grid-column: 1;
    }

    .shadcn-button {
        width: 100%;
    }

    .kenteken-wrapper {
        flex-direction: column;
    }

    .kenteken-wrapper .shadcn-button {
        width: 100%;
        margin-top: 0.5rem;
    }

    .toevoeging-wrapper {
        flex-direction: column;
    }

    .toevoeging-wrapper .shadcn-button {
        width: 100%;
        margin-top: 0.5rem;
    }

    .address-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-field-inline {
        flex: 1;
    }

    .postcode-width {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .coverage-grid-shadcn {
        grid-template-columns: 1fr;
    }

    .toast-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        max-width: none;
    }
}

/* Coverage Grid with Shadcn UI */
.coverage-grid-shadcn {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1200px) {
    .coverage-grid-shadcn {
        grid-template-columns: repeat(3, 1fr);
    }
}

.coverage-card-shadcn {
    background: var(--white);
    border: 1.5px solid var(--allianz-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.coverage-card-shadcn:hover {
    border-color: var(--allianz-blue-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.coverage-card-shadcn.selected {
    border-color: var(--allianz-blue);
    background: rgba(0, 61, 165, 0.02);
}

.coverage-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--allianz-blue);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.coverage-content p {
    color: var(--allianz-gray-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Shadcn Checkbox */
.shadcn-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.shadcn-checkbox-wrapper:hover {
    background-color: var(--allianz-gray);
}

.shadcn-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--allianz-blue);
    border: 2px solid var(--allianz-border);
    border-radius: 4px;
    appearance: none;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.shadcn-checkbox:checked {
    background-color: var(--allianz-blue);
    border-color: var(--allianz-blue);
}

.shadcn-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.shadcn-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.shadcn-checkbox-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 300px;
    max-width: 400px;
    border-left: 4px solid var(--allianz-blue);
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-notification.toast-success {
    border-left-color: var(--allianz-success);
}

.toast-notification.toast-error {
    border-left-color: var(--allianz-error);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--allianz-success);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.toast-error .toast-icon {
    background: var(--allianz-error);
}

.toast-message {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Animation for form fields */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-field {
    animation: slideIn 0.3s ease-out;
}

.form-field:nth-child(1) { animation-delay: 0.05s; }
.form-field:nth-child(2) { animation-delay: 0.1s; }
.form-field:nth-child(3) { animation-delay: 0.15s; }
.form-field:nth-child(4) { animation-delay: 0.2s; }
.form-field:nth-child(5) { animation-delay: 0.25s; }
.form-field:nth-child(6) { animation-delay: 0.3s; }

/* Coverage cards animation */
.coverage-card-shadcn {
    animation: slideIn 0.3s ease-out;
}

.coverage-card-shadcn:nth-child(1) { animation-delay: 0.05s; }
.coverage-card-shadcn:nth-child(2) { animation-delay: 0.1s; }
.coverage-card-shadcn:nth-child(3) { animation-delay: 0.15s; }
.coverage-card-shadcn:nth-child(4) { animation-delay: 0.2s; }
.coverage-card-shadcn:nth-child(5) { animation-delay: 0.25s; }
.coverage-card-shadcn:nth-child(6) { animation-delay: 0.3s; }

/* Overview Page Styles */
.overview-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.overview-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--allianz-border);
}

.overview-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.overview-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--allianz-blue);
    margin-bottom: 1.5rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overview-label {
    font-weight: 600;
    color: var(--allianz-gray-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-value {
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 500;
}

.overview-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.overview-list-item {
    padding: 1rem;
    background: var(--allianz-gray);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--allianz-blue);
    font-weight: 500;
    color: var(--text);
}

.overview-empty {
    color: var(--allianz-gray-dark);
    font-style: italic;
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .overview-container {
        padding: 1.5rem;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .overview-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
}

