/* XeIsuzu VN - Loan Calculator Styles */

.xei-loan-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    color: #1a1a1a;
}

/* Header */
.xei-loan-header {
    text-align: center;
    margin-bottom: 28px;
}
.xei-loan-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #c8151b;
    margin: 0 0 6px;
}
.xei-loan-subtitle {
    font-size: 0.92rem;
    color: #666;
    margin: 0;
}

/* Form */
.xei-loan-form {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 28px;
}

.xei-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .xei-form-grid { grid-template-columns: 1fr; }
}

.xei-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.xei-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.xei-input {
    width: 100%;
    padding: 10px 56px 10px 12px;
    font-size: 0.97rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.xei-input::-webkit-outer-spin-button,
.xei-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.xei-input:focus {
    outline: none;
    border-color: #c8151b;
    box-shadow: 0 0 0 3px rgba(200,21,27,0.1);
    background: #fff;
}

.xei-unit {
    position: absolute;
    right: 10px;
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
    pointer-events: none;
}

.xei-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #888;
}
.xei-hint strong {
    color: #c8151b;
}

/* Submit button */
.xei-form-action {
    text-align: center;
}
.xei-btn-calculate {
    background: #c8151b;
    color: #fff;
    border: none;
    padding: 13px 44px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.01em;
}
.xei-btn-calculate:hover { background: #a8101a; }
.xei-btn-calculate:active { transform: scale(0.98); }
.xei-btn-calculate:disabled { background: #ccc; cursor: not-allowed; }

/* Summary cards */
.xei-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
@media (max-width: 700px) {
    .xei-summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
    .xei-summary-cards { grid-template-columns: 1fr; }
}

.xei-summary-card {
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
}
.xei-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.xei-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.xei-card-loan     { background: #fff4f4; }
.xei-card-loan .xei-card-label  { color: #a8101a; }
.xei-card-loan .xei-card-value  { color: #c8151b; }

.xei-card-principal { background: #fff8ee; }
.xei-card-principal .xei-card-label { color: #9a6200; }
.xei-card-principal .xei-card-value { color: #c47e00; }

.xei-card-interest  { background: #fff3e0; }
.xei-card-interest .xei-card-label  { color: #8b4e00; }
.xei-card-interest .xei-card-value  { color: #b86200; }

.xei-card-total    { background: #eef4ff; }
.xei-card-total .xei-card-label    { color: #1a4f9c; }
.xei-card-total .xei-card-value    { color: #1a5abf; }

/* Table area */
.xei-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.xei-table-title {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
    margin: 0;
}
.xei-btn-export {
    background: #1a5abf;
    color: #fff;
    border: none;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s;
}
.xei-btn-export:hover { background: #1a4f9c; }

.xei-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
}

.xei-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 560px;
}
.xei-table thead tr {
    background: #c8151b;
    color: #fff;
}
.xei-table thead th {
    padding: 11px 14px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}
.xei-table thead th:first-child { text-align: center; }

.xei-table tbody tr:nth-child(even) { background: #fafafa; }
.xei-table tbody tr:hover { background: #fff4f4; }
.xei-table tbody td {
    padding: 9px 14px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.xei-table tbody td:first-child {
    text-align: center;
    font-weight: 600;
    color: #888;
}

/* Promo period highlight */
.xei-table tbody tr.xei-promo-row td { background: #fffbf0 !important; }
.xei-table tbody tr.xei-promo-row td:first-child { color: #c47e00; }

/* Last row */
.xei-table tbody tr:last-child td { border-bottom: none; font-weight: 600; }

/* Disclaimer */
.xei-disclaimer {
    margin-top: 16px;
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
}

/* Error */
.xei-loan-error {
    background: #fff4f4;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    color: #c8151b;
    padding: 14px 18px;
    font-size: 0.92rem;
    margin-top: 16px;
}

/* Legend */
.xei-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #888;
}
.xei-legend-item { display: flex; align-items: center; gap: 5px; }
.xei-legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.xei-dot-promo  { background: #f5c518; }
.xei-dot-normal { background: #e5e5e5; }

/* Copyright */
.xei-copyright {
    margin-top: 10px;
    text-align: center;
    font-size: 0.78rem;
    color: #bbb;
}
.xei-copyright a {
    color: #ccc;
    text-decoration: none;
}
.xei-copyright a:hover {
    color: #c8151b;
    text-decoration: underline;
}
