/* ==========================================================================
   ISR Calculator — Estilo alineado a CURP Calculator
   ========================================================================== */

/* Container */
.isr-container {
    max-width: 900px;
    margin: 30px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #475569;
}

/* Header */
.isr-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.isr-header-icon {
    width: 44px;
    height: 44px;
    background: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.isr-header-text h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.isr-header-text p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}

/* Form */
.isr-form {
    padding: 0;
}

.isr-form-group {
    margin-bottom: 22px;
}

.isr-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
}

.isr-label-icon {
    display: flex;
    align-items: center;
    color: #2563eb;
}

.isr-helper {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

/* Input wrapper */
.isr-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.isr-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.isr-input-prefix,
.isr-input-suffix {
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    background: #f8fafc;
    user-select: none;
    white-space: nowrap;
}

.isr-input-prefix {
    border-right: 1px solid #e5e7eb;
    padding-right: 12px;
}

.isr-input-suffix {
    border-left: 1px solid #e5e7eb;
    padding-left: 12px;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.isr-input-wrapper input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    outline: none;
    min-width: 0;
}

.isr-input-wrapper input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Select */
.isr-form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    color: #1e293b;
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231e293b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 10px auto;
    padding-right: 36px;
}

.isr-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Checkbox options */
.isr-options-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.isr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: border-color 0.2s;
    user-select: none;
}

.isr-checkbox-label:hover {
    border-color: #3b82f6;
}

.isr-checkbox-label input[type="checkbox"] {
    display: none;
}

.isr-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.isr-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
    position: absolute;
    top: 1px;
    left: 4px;
}

.isr-checkbox-label input[type="checkbox"]:checked+.isr-checkmark {
    background: #2563eb;
    border-color: #2563eb;
}

.isr-checkbox-label input[type="checkbox"]:checked+.isr-checkmark::after {
    transform: rotate(45deg) scale(1);
}

/* Tooltip */
.isr-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    margin-left: auto;
    position: relative;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.isr-tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: -8px;
    background: #1e293b;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: normal;
    width: 200px;
    line-height: 1.4;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button */
.isr-btn {
    width: 100%;
    padding: 14px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.isr-btn:hover {
    background-color: #1d4ed8;
}

.isr-btn:active {
    transform: translateY(1px);
}

/* Results */
.isr-hidden {
    display: none !important;
}

.isr-results {
    margin-top: 24px;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero result */
.isr-result-hero {
    text-align: center;
    padding: 20px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    margin-bottom: 20px;
}

.isr-result-hero-label {
    font-size: 13px;
    font-weight: 600;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.isr-result-hero-amount {
    font-size: 32px;
    font-weight: 700;
    color: #15803d;
    letter-spacing: 1px;
}

.isr-result-hero-period {
    font-size: 13px;
    color: #166534;
    margin-top: 4px;
    opacity: 0.8;
}

/* Sections */
.isr-result-section {
    padding: 18px 0;
    border-bottom: 1px solid #e5e7eb;
}

.isr-result-section:last-of-type {
    border-bottom: none;
}

.isr-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 14px;
}

.isr-section-title svg {
    color: #2563eb;
    flex-shrink: 0;
}

/* Detail grid */
.isr-detail-grid {
    display: flex;
    flex-direction: column;
}

.isr-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.isr-detail-row:last-child {
    border-bottom: none;
}

.isr-detail-label {
    font-size: 13px;
    color: #64748b;
}

.isr-detail-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.isr-detail-value.isr-accent {
    color: #2563eb;
    font-weight: 700;
}

.isr-detail-value.isr-positive {
    color: #15803d;
}

.isr-detail-total {
    border-bottom: none;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #e5e7eb;
}

.isr-detail-total .isr-detail-label {
    font-weight: 600;
    color: #334155;
}

.isr-detail-total .isr-detail-value {
    font-size: 14px;
    font-weight: 700;
}

/* Summary */
.isr-result-summary {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.isr-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #334155;
}

.isr-summary-deduction {
    color: #dc2626;
}

.isr-summary-total {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 700;
    color: #15803d;
}

/* Effective rate */
.isr-effective-rate {
    margin-top: 18px;
}

.isr-rate-bar-container {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.isr-rate-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 0;
}

.isr-rate-info {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.isr-rate-info strong {
    color: #1e293b;
    font-weight: 700;
}

/* Disclaimer */
.isr-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 18px;
    padding: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

.isr-disclaimer svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #f59e0b;
}