/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(145deg, #f0f5fa 0%, #e6edf4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.page-wrapper {
    max-width: 1400px;
    width: 100%;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    margin: 2rem 0 2.5rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0b3b5c, #1a5f7a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.hero p {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* ===== SECTIONS ===== */
.container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section, .results-section {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 1.8rem 1.5rem;
    box-shadow: 0 20px 40px -12px rgba(0, 20, 30, 0.25), 0 8px 24px -6px rgba(0, 32, 64, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0b2a3c;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.required-badge {
    font-size: 0.8rem;
    background: #ffecd6;
    color: #b45f06;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    font-weight: 400;
}

.red {
    color: #c5221f;
    font-weight: 600;
}

/* ===== FORM GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-weight: 500;
    color: #1e3b4f;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.input-confirm {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.input-confirm input, .input-confirm select {
    flex: 2 1 200px;
    padding: 0.75rem 1rem;
    border: 1.5px solid #cfdee9;
    border-radius: 18px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,20,30,0.02);
}

.input-confirm input:focus, .input-confirm select:focus {
    outline: none;
    border-color: #1e6f9f;
    box-shadow: 0 0 0 3px rgba(23, 112, 161, 0.15);
}

.input-confirm input.error, .input-confirm select.error {
    border-color: #c5221f;
    background-color: #fff2f0;
}

.confirm-btn {
    background: white;
    border: 1.5px solid #1e6f9f;
    color: #1e6f9f;
    padding: 0.7rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 8px rgba(0,40,60,0.08);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.confirm-btn:hover {
    background: #1e6f9f;
    color: white;
    border-color: #1e6f9f;
    transform: scale(0.97);
    box-shadow: 0 8px 12px rgba(0,60,90,0.15);
}

.confirm-btn:active {
    transform: scale(0.95);
}

.input-confirm input:disabled, .input-confirm select:disabled {
    background-color: #ecf3f8;
    border-color: #b3c9d8;
    color: #2a4a62;
    opacity: 0.8;
    cursor: not-allowed;
}

.conversion {
    font-size: 0.8rem;
    color: #1f5a7a;
    margin-top: 0.2rem;
}

/* ===== COMPARABLES ===== */
.comparables-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* ===== RESULTS ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(145deg, #ffffff, #f5faff);
    border-radius: 28px;
    padding: 1.8rem 1.2rem;
    text-align: center;
    box-shadow: 0 12px 24px -12px rgba(0, 40, 60, 0.2);
    border: 1px solid rgba(255,255,255,0.7);
}

.result-card h3 {
    color: #154256;
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0d3f59;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.result-card small {
    color: #3f627c;
    font-size: 0.8rem;
}

.adjustment-table {
    background: white;
    border-radius: 24px;
    padding: 1.5rem 1rem;
    overflow-x: auto;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.02);
}

.adjustment-table h3 {
    margin-bottom: 1rem;
    color: #134257;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 700px;
}

.table-responsive th {
    background: #e1eff8;
    color: #0a3142;
    padding: 0.8rem 0.5rem;
    font-weight: 600;
}

.table-responsive td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #d0e2ee;
    text-align: center;
}

.table-responsive tr:last-child td {
    border-bottom: none;
}

/* ===== LP HIGHLIGHT ===== */
.lp-highlight {
    background: #dcfce7;
    border-left: 8px solid #2b7e4d;
    border-radius: 24px;
    padding: 1.5rem 2rem;
    margin-top: 1rem;
    box-shadow: 0 12px 24px -12px #1e4b3c;
    animation: fadeIn 0.5s ease;
}

.lp-highlight p {
    font-size: 1.2rem;
    color: #115c39;
    font-weight: 500;
}

.lp-highlight a {
    color: #0a5e34;
    font-weight: 700;
    text-decoration: underline;
    word-break: break-all;
}

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

/* ===== MODAL (restore-down style) ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    max-width: 500px;
    width: 90%;
    border-radius: 36px;
    box-shadow: 0 40px 70px -10px #0f2838;
    border: 1px solid rgba(255,255,255,0.6);
    overflow: hidden;
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.2rem 1.8rem;
    background: #f2f9ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #bdd6e8;
}

.modal-title {
    font-weight: 600;
    color: #0f3d58;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #1f618d;
    padding: 0 0.3rem;
}

.modal-body {
    padding: 2rem 1.8rem;
    color: #1d3b4f;
    font-size: 1.1rem;
}

.modal-body a {
    color: #1f6e9c;
    font-weight: 600;
}

.modal-footer {
    padding: 1rem 1.8rem 1.8rem;
    text-align: right;
}

.btn-minimize {
    background: #e7f0f9;
    border: none;
    padding: 0.7rem 1.8rem;
    border-radius: 40px;
    font-weight: 500;
    color: #1d577b;
    cursor: pointer;
    border: 1px solid #afcde0;
    transition: 0.2s;
}

.btn-minimize:hover {
    background: #d2e5f5;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 2rem 0.5rem 0.5rem;
    color: #385f78;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .form-section, .results-section { padding: 1.5rem 1rem; }
    .input-confirm { flex-wrap: wrap; }
    .confirm-btn { width: 100%; justify-content: center; }
    .result-value { font-size: 1.8rem; }
}

@media (max-width: 380px) {
    .required-badge { font-size: 0.7rem; }
}