/**
 * @file
 * Property Insurance Form Styles
 */

/* Start Form Styles */
.property-insurance-form .contractor-section {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.property-insurance-form .product-details-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.property-insurance-form .coverage-details-table {
    width: 100%;
    margin: 15px 0;
}

.property-insurance-form .coverage-details-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.property-insurance-form .coverage-details-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.property-insurance-form .coverage-details-table .insured-sum {
    text-align: right;
    font-weight: 600;
    color: #2c5aa0;
}

.property-insurance-form .premium-display {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #2c5aa0;
    border-radius: 4px;
}

.property-insurance-form .premium-amount {
    font-size: 1.2em;
}

.property-insurance-form .premium-amount .amount {
    color: #2c5aa0;
    font-weight: 700;
    font-size: 1.3em;
}

.property-insurance-form .risks-description {
    padding: 10px;
    line-height: 1.6;
    color: #666;
}

/* Details Form Styles */
.property-insurance-details-form {
    /*display: grid;*/
    /*grid-template-columns: 1fr 300px;*/
    gap: 30px;
}

@media (max-width: 992px) {
    .property-insurance-details-form {
        grid-template-columns: 1fr;
    }
}

.property-insurance-details-form .coverage-sidebar {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.property-insurance-details-form .coverage-sidebar h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3em;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 10px;
}

.property-insurance-details-form .product-name {
    margin: 15px 0;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.property-insurance-details-form .coverage-summary-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.property-insurance-details-form .coverage-summary-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.property-insurance-details-form .coverage-summary-list li:last-child {
    border-bottom: none;
}

.property-insurance-details-form .premium-summary {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 4px;
    font-size: 1.1em;
    text-align: center;
}

.property-insurance-details-form .main-content-area {
    min-width: 0;
}

.property-insurance-details-form details {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.property-insurance-details-form details summary {
    background: #f5f5f5;
    padding: 15px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.property-insurance-details-form details[open] summary {
    background: #e8f4f8;
    border-bottom: 1px solid #e0e0e0;
}

.property-insurance-details-form details > div {
    padding: 20px;
}

.property-insurance-details-form fieldset {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.property-insurance-details-form .add-person-button {
    margin-top: 15px;
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.property-insurance-details-form .add-person-button:hover {
    background: #218838;
}

/* Summary Form Styles */
.property-insurance-summary-form .summary-layout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .property-insurance-summary-form .summary-layout-container {
        grid-template-columns: 1fr;
    }
}

.property-insurance-summary-form .summary-left-column fieldset {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.property-insurance-summary-form .summary-left-column fieldset legend {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    padding: 0 10px;
}

.property-insurance-summary-form .summary-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.property-insurance-summary-form .summary-item:last-child {
    border-bottom: none;
}

.property-insurance-summary-form .coverage-summary-table {
    width: 100%;
    margin: 15px 0;
}

.property-insurance-summary-form .coverage-summary-table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.property-insurance-summary-form .coverage-summary-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.property-insurance-summary-form .coverage-summary-table .coverage-amount {
    text-align: right;
    font-weight: 600;
    color: #2c5aa0;
}

.property-insurance-summary-form .summary-right-column {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.property-insurance-summary-form .premium-box {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a6d 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.property-insurance-summary-form .premium-total {
    text-align: center;
}

.property-insurance-summary-form .premium-total .label {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.property-insurance-summary-form .premium-total .amount {
    font-size: 2.5em;
    font-weight: 700;
    display: block;
}

.property-insurance-summary-form .contact-details-section,
.property-insurance-summary-form .payment-method-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Common Styles */
.wizard-layout-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 30px;
}

.wizard-layout-footer .button {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.wizard-layout-footer .back-button {
    background: #6c757d;
    color: white;
    border: none;
}

.wizard-layout-footer .back-button:hover {
    background: #5a6268;
}

.wizard-layout-footer .next-button,
.wizard-layout-footer .checkout-button {
    background: #2c5aa0;
    color: white;
    border: none;
}

.wizard-layout-footer .next-button:hover,
.wizard-layout-footer .checkout-button:hover {
    background: #1e3a6d;
}

/* Insurance Period */
.insurance-period-wrapper {
    background: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
}

.insurance-period-wrapper .form-item {
    margin-bottom: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .property-insurance-details-form,
    .property-insurance-summary-form .summary-layout-container {
        grid-template-columns: 1fr;
    }

    .property-insurance-details-form .coverage-sidebar,
    .property-insurance-summary-form .summary-right-column {
        position: static;
    }

    .wizard-layout-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .wizard-layout-footer .button {
        width: 100%;
        text-align: center;
    }
}

/* Loading State */
.show-loader:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.show-loader:disabled::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}
/**
 * Property Insurance Details Form Styles
 */

/* Insured Persons Section */
.insured-person-fieldset {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.insured-person-fieldset legend {
    font-weight: bold;
    font-size: 1.1em;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* Remove Person Button */
.remove-person-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.remove-person-button:hover {
    background-color: #c82333;
    color: white;
}

.remove-person-button:active {
    background-color: #bd2130;
}

/* Add Person Actions Container */
.insured-persons-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
}

.add-person-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.add-person-button:hover {
    background-color: #218838;
    color: white;
}

.add-person-button:active {
    background-color: #1e7e34;
}

/* Person Fieldset Grid Layout */
.insured-person-fieldset .form-item {
    margin-bottom: 1rem;
}

/* Responsive layout for person fields */
@media (min-width: 768px) {
    .insured-person-fieldset {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .insured-person-fieldset .form-item {
        margin-bottom: 0;
    }

    .insured-person-fieldset .remove-person-button {
        grid-column: 1 / -1;
        width: auto;
        justify-self: end;
    }
}

/* Info message styling */
.insured-persons-section .messages--info {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

/* Danger button state */
.button--danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.button--danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Person counter badge */
.insured-person-fieldset legend::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    margin-left: 0.5rem;
}

/* Animation for adding/removing persons */
.insured-person-fieldset {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for buttons */
.add-person-button.is-loading,
.remove-person-button.is-loading {
    position: relative;
    color: transparent;
}

.add-person-button.is-loading::after,
.remove-person-button.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Disabled state */
.remove-person-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Focus states for accessibility */
.add-person-button:focus,
.remove-person-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Person section header with count */
.insured-persons-section > summary::after {
    content: ' (' attr(data-person-count) ')';
    font-weight: normal;
    color: #6c757d;
}

/* Empty state message */
.insured-persons-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .insured-person-fieldset {
        padding: 1rem;
    }

    .remove-person-button,
    .add-person-button {
        width: 100%;
        margin-top: 1rem;
    }

    .insured-persons-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Success/Error messages within person section */
.insured-person-fieldset .messages {
    margin-bottom: 1rem;
}

/* Highlight effect when person is added */
.insured-person-fieldset.newly-added {
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0%, 100% {
        background-color: #fff;
    }
    50% {
        background-color: #d4edda;
    }
}