/**
 * PEHOMA Renta Calculator Styles
 * @package Pehoma.RentaCalc
 */

:root {
    --pehoma-blue: #1B4F72;
    --pehoma-light-blue: #D6EAF8;
    --pehoma-gray: #F2F3F4;
    --pehoma-border: #BDC3C7;
    --pehoma-warning: #FEF9E7;
    --pehoma-success: #D4EDDA;
    --pehoma-error: #F8D7DA;
}

.rentacalc-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.rentacalc-header {
    background: var(--pehoma-blue);
    color: white;
    padding: 25px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.rentacalc-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.rentacalc-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.rentacalc-body {
    background: white;
    border: 1px solid var(--pehoma-border);
    border-top: none;
    padding: 25px;
    border-radius: 0 0 8px 8px;
    overflow: visible;
    height: auto;
}

.rentacalc-step {
    display: none;
    animation: fadeIn 0.3s ease;
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}

.rentacalc-step.active,
.rentacalc-step[style*="display:block"],
.rentacalc-step[style*="display: block"] {
    display: block;
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}

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

.rentacalc-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--pehoma-gray);
    border-radius: 6px;
}

.rentacalc-section h3 {
    color: var(--pehoma-blue);
    margin: 0 0 20px 0;
    font-size: 18px;
    border-bottom: 2px solid var(--pehoma-blue);
    padding-bottom: 10px;
}

.rentacalc-section h4 {
    color: #333;
    margin: 20px 0 15px 0;
    font-size: 15px;
    font-weight: bold;
}

.rentacalc-section h4:first-of-type {
    margin-top: 0;
}

.rentacalc-field {
    margin-bottom: 18px;
}

.rentacalc-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

.rentacalc-field select,
.rentacalc-field input[type="number"],
.rentacalc-field input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--pehoma-border);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background: white;
}

.rentacalc-field select:focus,
.rentacalc-field input:focus {
    outline: none;
    border-color: var(--pehoma-blue);
    box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.15);
}

.rentacalc-field.error select,
.rentacalc-field.error input {
    border-color: #dc3545;
}

.rentacalc-checkbox {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 8px 0;
}

.rentacalc-checkbox input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rentacalc-checkbox label {
    font-weight: normal;
    cursor: pointer;
    line-height: 1.4;
}

.rentacalc-info {
    background: var(--pehoma-light-blue);
    border: 1px solid var(--pehoma-blue);
    border-left: 4px solid var(--pehoma-blue);
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-size: 13px;
}

.rentacalc-info.warning {
    background: var(--pehoma-warning);
    border-color: #F39C12;
    border-left-color: #F39C12;
}

.rentacalc-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--pehoma-border);
}

.rentacalc-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.rentacalc-btn-primary {
    background: var(--pehoma-blue);
    color: white;
}

.rentacalc-btn-primary:hover {
    background: #154360;
    color: white;
}

.rentacalc-btn-secondary {
    background: #6c757d;
    color: white;
}

.rentacalc-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.rentacalc-btn-success {
    background: #28a745;
    color: white;
    font-size: 18px;
    padding: 16px 40px;
}

.rentacalc-btn-success:hover {
    background: #218838;
    color: white;
}

.rentacalc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress */
.rentacalc-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 0;
}

.rentacalc-progress-step {
    display: flex;
    align-items: center;
}

.rentacalc-progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pehoma-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.3s;
}

.rentacalc-progress-dot.active {
    background: var(--pehoma-blue);
    transform: scale(1.1);
}

.rentacalc-progress-dot.completed {
    background: #28a745;
}

.rentacalc-progress-line {
    width: 60px;
    height: 4px;
    background: var(--pehoma-border);
    margin: 0 8px;
    transition: background 0.3s;
}

.rentacalc-progress-line.completed {
    background: #28a745;
}

/* Result */
.rentacalc-result {
    background: white;
    border: 2px solid var(--pehoma-blue);
    border-radius: 8px;
    overflow: hidden;
}

.rentacalc-result-header {
    background: var(--pehoma-blue);
    color: white;
    padding: 18px 25px;
    text-align: center;
}

.rentacalc-result-header h3 {
    margin: 0;
    color: white;
    border: none;
    padding: 0;
    font-size: 20px;
}

.rentacalc-result-body {
    padding: 25px;
}

.rentacalc-breakdown {
    margin-bottom: 20px;
}

.rentacalc-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.rentacalc-breakdown-item:last-child {
    border-bottom: none;
}

.rentacalc-breakdown-item.subtotal {
    font-weight: bold;
    background: var(--pehoma-gray);
    margin: 15px -25px;
    padding: 12px 25px;
    border-bottom: none;
}

.rentacalc-breakdown-item.total {
    font-size: 20px;
    font-weight: bold;
    color: var(--pehoma-blue);
    background: var(--pehoma-light-blue);
    margin: 15px -25px -25px -25px;
    padding: 18px 25px;
    border-bottom: none;
}

.rentacalc-disclaimer {
    background: var(--pehoma-warning);
    border: 1px solid #F39C12;
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
}

.rentacalc-disclaimer h4 {
    margin: 0 0 12px 0;
    color: #856404;
    font-size: 16px;
}

.rentacalc-disclaimer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
}

.rentacalc-order-section {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: var(--pehoma-gray);
    border-radius: 8px;
}

.rentacalc-order-section p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

/* Reference number */
.rentacalc-reference {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.rentacalc-reference code {
    font-size: 16px;
    font-weight: bold;
    color: var(--pehoma-blue);
}

/* Loading */
.rentacalc-loading {
    display: none;
    text-align: center;
    padding: 50px;
}

.rentacalc-loading.active {
    display: block;
}

.rentacalc-spinner {
    border: 4px solid var(--pehoma-gray);
    border-top: 4px solid var(--pehoma-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .rentacalc-container {
        margin: 10px;
    }
    
    .rentacalc-header {
        padding: 20px 15px;
    }
    
    .rentacalc-header h2 {
        font-size: 20px;
    }
    
    .rentacalc-body {
        padding: 15px;
    }
    
    .rentacalc-section {
        padding: 15px;
    }
    
    .rentacalc-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .rentacalc-btn {
        width: 100%;
        text-align: center;
    }
    
    .rentacalc-progress-line {
        width: 30px;
    }
    
    .rentacalc-progress-dot {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .rentacalc-breakdown-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .rentacalc-breakdown-item span:last-child {
        font-weight: bold;
    }
}

/* Help text */
.rentacalc-help {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

/* Breakdown table */
.rentacalc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rentacalc-breakdown-table th,
.rentacalc-breakdown-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.rentacalc-breakdown-table thead th {
    background: var(--pehoma-blue);
    color: white;
    font-weight: 600;
    text-align: left;
}

.rentacalc-breakdown-table thead th.text-right {
    text-align: right;
}

.rentacalc-breakdown-table tbody tr:hover {
    background: #f8f9fa;
}

.rentacalc-breakdown-table tbody td small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.rentacalc-breakdown-table tfoot td,
.rentacalc-breakdown-table tfoot th {
    padding: 10px;
}

.rentacalc-breakdown-table tfoot tr.subtotal td,
.rentacalc-breakdown-table tfoot tr.subtotal th {
    border-top: 2px solid var(--pehoma-border);
    background: #f2f3f4;
}

.rentacalc-breakdown-table tfoot tr.total td,
.rentacalc-breakdown-table tfoot tr.total th {
    background: var(--pehoma-blue);
    color: white;
    font-size: 16px;
}

.text-right { text-align: right; }
.text-nowrap { white-space: nowrap; }
.text-muted { color: #666; }

/* Result notes */
.rentacalc-result-notes {
    margin-top: 20px;
}

.rentacalc-result-notes .rentacalc-info {
    margin-bottom: 15px;
}

.rentacalc-result-notes ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.rentacalc-result-notes li {
    margin-bottom: 8px;
}

/* Outline button */
.rentacalc-btn-outline {
    background: transparent;
    color: var(--pehoma-blue);
    border: 2px solid var(--pehoma-blue);
}

.rentacalc-btn-outline:hover {
    background: var(--pehoma-light-blue);
}

/* Large button */
.rentacalc-btn-large {
    padding: 15px 40px;
    font-size: 16px;
}

.rentacalc-btn-large:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Step intro text */
.rentacalc-step-intro {
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Print styles */
@media print {
    .rentacalc-buttons,
    .rentacalc-progress,
    .rentacalc-order-section {
        display: none !important;
    }
    
    .rentacalc-container {
        max-width: 100%;
    }
    
    .rentacalc-step {
        display: block !important;
    }
    
    .rentacalc-step:not([data-step="4"]) {
        display: none !important;
    }
}

/* Honeypot fields - hidden from humans */
.rentacalc-hp-wrap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* Config loading overlay */
.rentacalc-loading-config {
    position: relative;
    min-height: 200px;
    pointer-events: none;
    opacity: 0.5;
}
.rentacalc-loading-config::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: rentacalc-spin 0.8s linear infinite;
}
@keyframes rentacalc-spin { to { transform: rotate(360deg); } }
