/* ================================================
   RENT & BUY CALCULATOR — Professional Banking Style
   ================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

main.container {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 48px;
}

/* ---------- Card ---------- */
.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 28px 32px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

/* ---------- Section Titles ---------- */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: -0.01em;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header-row .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5282 100%);
    color: #ffffff;
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(26,58,92,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header__logo {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
    transition: transform 0.3s ease;
}

.header__logo:hover {
    transform: scale(1.05);
}

.header__title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header__subtitle {
    font-size: 0.8rem;
    font-weight: 300;
    opacity: 0.85;
    letter-spacing: 0.03em;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 3px;
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
}

.lang-btn:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
}

.lang-btn.active {
    background: #ffffff;
    color: #1a3a5c;
}

/* ========================================
   OFFER SECTION
   ======================================== */
.offer-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

.offer-photo-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
    padding: 16px;
}

.offer-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.offer-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.offer-detail-row:last-of-type {
    border-bottom: none;
}

.offer-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.offer-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a202c;
    text-align: right;
}

.offer-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.offer-description p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.7;
}

/* ========================================
   CALCULATOR FORM
   ======================================== */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group--full {
    grid-column: 1 / -1;
}

.calc-form label,
.form-label-block {
    font-size: 0.82rem;
    font-weight: 500;
    color: #4a5568;
    letter-spacing: 0.01em;
}

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

.form-input {
    width: 100%;
    padding: 12px 60px 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    color: #1a202c;
    background: #f8fafc;
    border: 1.5px solid #d1d9e6;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.form-input::-webkit-inner-spin-button,
.form-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
    background: #ffffff;
}

.form-input.error {
    border-color: #c53030;
    box-shadow: 0 0 0 3px rgba(197,48,48,0.1);
}

.input-suffix {
    position: absolute;
    right: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: none;
}

.form-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Date input with icon */
.input-wrapper--icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.form-input--date {
    padding-left: 42px;
    cursor: pointer;
}

.form-input--date::placeholder {
    color: #94a3b8;
}

/* Flatpickr overrides to match banking style */
.flatpickr-calendar {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
}

.flatpickr-months {
    background: #1a3a5c !important;
    border-radius: 10px 10px 0 0;
}

.flatpickr-months .flatpickr-month {
    background: #1a3a5c !important;
    height: 42px !important;
    overflow: visible !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: #ffffff !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    fill: #cbd5e0 !important;
    color: #cbd5e0 !important;
}

.flatpickr-current-month {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    padding-top: 8px !important;
}

/* Month dropdown — the key fix */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #ffffff !important;
    font-weight: 600 !important;
    background: #1a3a5c !important;
    border: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-size: 1rem !important;
    padding: 2px 4px !important;
    cursor: pointer !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: #2c5282 !important;
    border-radius: 4px !important;
}

/* Style the dropdown options (when opened) */
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #ffffff !important;
    color: #1a202c !important;
    font-size: 0.9rem !important;
    padding: 4px 8px !important;
}

.flatpickr-current-month input.cur-year {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

span.flatpickr-weekday {
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

.flatpickr-day {
    border-radius: 6px !important;
    font-weight: 500 !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #1a3a5c !important;
    border-color: #1a3a5c !important;
    color: #ffffff !important;
}

.flatpickr-day:hover {
    background: #edf2f7 !important;
    border-color: #edf2f7 !important;
}

.flatpickr-day.today {
    border-color: #2c5282 !important;
}

.flatpickr-innerContainer {
    border-bottom: none !important;
}

.flatpickr-rContainer {
    width: 100% !important;
}

/* Percent slider under input */
.percent-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.slider--small {
    height: 4px;
}

.slider--small::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
}

.slider--small::-moz-range-thumb {
    width: 18px;
    height: 18px;
}

.slider-value--small {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 42px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.radio-group--inline {
    flex-direction: row;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2d3748;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #1a3a5c;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1a3a5c;
}

/* Slider */
.rent-credit-slider {
    margin-top: 12px;
    padding: 16px 20px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rent-credit-slider label {
    display: block;
    margin-bottom: 10px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a3a5c;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a3a5c;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.slider-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a3a5c;
    min-width: 50px;
    text-align: right;
}

/* Buttons */
.form-actions {
    padding-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5282 100%);
    color: #ffffff;
    padding: 14px 36px;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(26,58,92,0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(26,58,92,0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26,58,92,0.3);
}

.btn-secondary {
    background: #f8fafc;
    color: #1a3a5c;
    border: 1.5px solid #d1d9e6;
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #1a3a5c;
}

/* ========================================
   RESULTS SECTION
   ======================================== */
.results-section {
    animation: fadeIn 0.4s ease;
}

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

/* Warnings */
.warnings-container {
    margin-bottom: 16px;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box::before {
    content: '\26A0';
    font-size: 1.1rem;
}

/* ========================================
   TERMS SECTION — Unified financial summary
   ======================================== */

/* Deal structure tiles */
.deal-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.deal-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}

.deal-tile__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 6px;
}

.deal-tile__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a3a5c;
    font-variant-numeric: tabular-nums;
}

.deal-tile__sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 400;
}

/* Monthly payment hero */
.monthly-hero {
    background: linear-gradient(135deg, #1a3a5c 0%, #243f6c 50%, #2c5282 100%);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 28px;
    color: #ffffff;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 0;
}

.monthly-hero__block {
    text-align: center;
    padding: 4px 16px;
}

.monthly-hero__block--main {
    padding: 4px 24px;
}

.monthly-hero__divider {
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,0.2);
}

.monthly-hero__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
    font-weight: 500;
    margin-bottom: 6px;
}

.monthly-hero__amount {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.monthly-hero__amount--big {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.monthly-hero__amount--accent {
    color: #f5e6b8;
}

.monthly-hero__range-line {
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   UNIFIED FINANCIAL TABLE
   ======================================== */
.fin-table {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* Section header (group separator) */
.fin-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
}

.fin-section:first-child {
    border-top: none;
}

.fin-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #cbd5e0;
}

/* Row */
.fin-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.88rem;
    gap: 16px;
}

.fin-row:first-child,
.fin-section + .fin-row {
    border-top: none;
}

.fin-row__label {
    color: #2d3748;
    font-weight: 400;
}

.fin-row__detail {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 400;
}

.fin-row__buyer {
    font-weight: 600;
    color: #1a3a5c;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

.fin-row__owner {
    font-weight: 600;
    color: #166534;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

.fin-row__muted {
    color: #94a3b8;
    font-weight: 400;
}

/* Column headers */
.fin-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    padding: 14px 20px 10px;
    gap: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.fin-header__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.fin-header__col {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
    min-width: 130px;
}

.fin-header__col--buyer {
    color: #1a3a5c;
}

.fin-header__col--owner {
    color: #166534;
}

/* Total row */
.fin-total {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
    background: #f8fafc;
    border-top: 2px solid #1a3a5c;
}

.fin-total__label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a202c;
}

.fin-total__buyer {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a3a5c;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

.fin-total__owner {
    font-size: 1.15rem;
    font-weight: 700;
    color: #166534;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

/* Result / profit row */
.fin-result {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 14px 20px;
    gap: 16px;
    border-top: 1px solid #e2e8f0;
}

.fin-result__label {
    font-size: 0.85rem;
    color: #4a5568;
}

.fin-result__buyer {
    font-weight: 600;
    color: #c53030;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

.fin-result__owner {
    font-weight: 700;
    color: #166534;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

/* Accent for net rent income */
.fin-row--accent {
    background: #f0fdf4;
}

/* Responsive */
@media (max-width: 600px) {
    .fin-row, .fin-header, .fin-total, .fin-result {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .fin-header__col--owner,
    .fin-row__owner,
    .fin-total__owner,
    .fin-result__owner {
        display: none;
    }
    .fin-row__buyer, .fin-total__buyer, .fin-result__buyer,
    .fin-header__col {
        min-width: 100px;
    }
}

/* ========================================
   SCHEDULE TABLE
   ======================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.schedule-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.schedule-table th {
    background: #1a3a5c;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    text-align: right;
    white-space: nowrap;
}

.schedule-table th:first-child {
    text-align: center;
}

.schedule-table td {
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    color: #2d3748;
}

.schedule-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: #64748b;
}

.schedule-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.schedule-table tbody tr:hover {
    background: #edf2f7;
}

.schedule-table tbody tr.row-highlight {
    background: #eff6ff;
    font-weight: 600;
}

.schedule-table tbody tr.row-highlight td {
    color: #1a3a5c;
}

.schedule-table tfoot tr {
    background: #f0f4f8;
    font-weight: 700;
}

.schedule-table tfoot td {
    padding: 14px;
    border-top: 2px solid #1a3a5c;
    color: #1a3a5c;
    font-size: 0.85rem;
}

/* ========================================
   FOOTER
   ======================================== */
.results-footer {
    background: #f8fafc;
}

.disclaimer {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.6;
    font-style: italic;
}

.generated-date {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 8px;
}

.page-footer {
    background: #1a3a5c;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 16px 0;
    font-size: 0.78rem;
}

.page-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.page-footer a:hover {
    color: #ffffff;
}

/* ========================================
   PDF-ONLY STYLES
   ======================================== */
.pdf-only {
    position: absolute;
    left: -9999px;
}

.pdf-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #1a3a5c;
    margin-bottom: 20px;
}

.pdf-header h1 {
    font-size: 1.3rem;
    color: #1a3a5c;
}

.pdf-header p {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    .card {
        padding: 20px;
    }

    .header__title {
        font-size: 1.1rem;
    }

    .header__subtitle {
        font-size: 0.72rem;
    }

    .offer-grid {
        grid-template-columns: 1fr;
    }

    .offer-photo-placeholder {
        max-width: 320px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .deal-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .monthly-hero {
        grid-template-columns: 1fr;
        gap: 0;
        text-align: center;
        padding: 20px;
    }

    .monthly-hero__divider {
        width: 100%;
        height: 1px;
        margin: 12px 0;
    }

    .monthly-hero__block {
        padding: 8px 0;
    }

    .radio-group--inline {
        flex-direction: column;
        gap: 10px;
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 14px;
    }

    .card {
        padding: 16px;
        border-radius: 8px;
    }

    .header {
        padding: 12px 0;
    }

    .header__brand {
        gap: 10px;
    }

    .header__logo svg {
        width: 34px;
        height: 34px;
    }

    .header__title {
        font-size: 1rem;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .form-input {
        padding: 10px 50px 10px 12px;
        font-size: 0.95rem;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }

    .summary-panel {
        padding: 16px;
    }

    .schedule-table {
        font-size: 0.75rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 8px 10px;
    }
}

/* ========================================
   HEADER AUTH ACTIONS
   ======================================== */
.header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-auth {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-auth:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.btn-auth--logout {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    font-weight: 400;
}

.btn-auth--logout:hover {
    background: rgba(220,50,50,0.2);
    border-color: rgba(220,50,50,0.4);
    color: #fecaca;
}

/* ========================================
   LANDING PAGE
   ======================================== */

/* Hero */
.landing-hero {
    background: linear-gradient(135deg, #0f2439 0%, #1a3a5c 40%, #2c5282 100%);
    color: #ffffff;
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(212,168,75,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.landing-hero__content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.landing-hero__title {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.landing-hero__subtitle {
    font-size: 1.15rem;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0 0 36px;
    font-weight: 300;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #d4a84b 0%, #f0d68a 50%, #d4a84b 100%);
    background-size: 200% auto;
    color: #1a2a3c;
    border: none;
    padding: 16px 36px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(212,168,75,0.3);
}

.btn-cta:hover {
    background-position: right center;
    box-shadow: 0 6px 28px rgba(212,168,75,0.45);
    transform: translateY(-1px);
}

/* Sections */
.landing-section {
    padding: 72px 0;
}

.landing-section--alt {
    background: #f8fafc;
}

.landing-section__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a3a5c;
    text-align: center;
    margin: 0 0 16px;
}

.landing-section__text {
    font-size: 1.05rem;
    color: #4a5568;
    line-height: 1.75;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

/* Benefits */
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 40px;
}

.benefits-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.benefits-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.benefits-card__icon {
    margin-bottom: 16px;
}

.benefits-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 16px;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    position: relative;
    padding: 8px 0 8px 24px;
    font-size: 0.92rem;
    color: #4a5568;
    line-height: 1.5;
}

.benefits-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4a84b;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.step-card {
    text-align: center;
    padding: 24px 16px;
}

.step-card__number {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5282);
    color: #f5e6b8;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(26,58,92,0.2);
}

.step-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 8px;
}

.step-card__text {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* CTA Section */
.landing-cta {
    background: linear-gradient(135deg, #0f2439, #1a3a5c);
    color: #ffffff;
    padding: 72px 0;
    text-align: center;
}

.landing-cta__title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.landing-cta__text {
    font-size: 1.05rem;
    opacity: 0.8;
    margin: 0 0 32px;
    font-weight: 300;
}

/* ========================================
   LOGIN MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #4a5568;
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-logo {
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0;
}

.modal-form-group {
    margin-bottom: 18px;
}

.modal-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.modal-form-group .form-input {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
}

.login-error {
    background: #fef2f2;
    color: #c53030;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: center;
}

.btn-login-submit {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 1rem;
    margin-top: 4px;
}

/* ========================================
   LANDING RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .landing-hero {
        padding: 64px 0 56px;
    }

    .landing-hero__title {
        font-size: 1.7rem;
    }

    .landing-hero__subtitle {
        font-size: 1rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .landing-section {
        padding: 48px 0;
    }

    .landing-cta {
        padding: 48px 0;
    }

    .landing-section__title,
    .landing-cta__title {
        font-size: 1.4rem;
    }

    .header__actions {
        gap: 8px;
    }

    .btn-auth {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .landing-hero {
        padding: 48px 0 40px;
    }

    .landing-hero__title {
        font-size: 1.4rem;
    }

    .landing-hero__subtitle {
        font-size: 0.9rem;
    }

    .btn-cta {
        padding: 14px 28px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .benefits-card {
        padding: 24px 20px;
    }

    .modal-card {
        padding: 28px 24px;
    }
}

/* ========================================
   BOTTOM NAVIGATION BAR
   ======================================== */
.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-bar__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.bottom-bar__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 20px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.bottom-bar__item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    transition: all 0.2s;
}

.bottom-bar__item.active {
    color: #1a3a5c;
}

.bottom-bar__item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(135deg, #d4a84b, #f0d68a);
}

.bottom-bar__item.active svg {
    stroke-width: 2.3;
}

.bottom-bar__item:active {
    transform: scale(0.9);
}

/* Show bottom bar only on mobile/tablet */
@media (max-width: 768px) {
    .bottom-bar {
        display: block;
    }

    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .btn-auth {
        display: none !important;
    }

    .header {
        padding: 10px 0;
    }

    .page-footer {
        margin-bottom: 0;
    }
}

/* ========================================
   APP-LIKE MOBILE ENHANCEMENTS
   ======================================== */
@media (max-width: 768px) {
    /* Smoother scrolling */
    html {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Touch-friendly larger tap targets */
    .form-input {
        min-height: 48px;
        font-size: 16px !important; /* prevent iOS zoom on focus */
    }

    .btn-primary {
        min-height: 50px;
    }

    .radio-label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Cards with more rounded corners like app */
    .card {
        border-radius: 16px;
        border: none;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    /* Landing hero smaller padding */
    .landing-hero {
        padding: 56px 0 48px;
    }

    .landing-hero__title {
        font-size: 1.6rem;
        font-weight: 800;
    }

    /* Compact section titles */
    .section-title {
        font-size: 1.1rem;
    }

    .landing-section__title,
    .landing-cta__title {
        font-size: 1.3rem;
        font-weight: 800;
    }

    /* Steps as horizontal scroll */
    .steps-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 8px;
        margin: 24px -14px 0;
        padding-left: 14px;
        padding-right: 14px;
    }

    .steps-grid::-webkit-scrollbar {
        display: none;
    }

    .step-card {
        min-width: 220px;
        scroll-snap-align: start;
        background: #ffffff;
        border-radius: 14px;
        padding: 20px 16px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        flex-shrink: 0;
    }

    .step-card__number {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    /* Benefits cards more app-like */
    .benefits-card {
        border-radius: 14px;
        padding: 24px 20px;
        border: none;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    /* CTA button full width on mobile */
    .btn-cta {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        border-radius: 14px;
        font-size: 1rem;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .landing-hero__title {
        font-size: 1.35rem;
    }

    .landing-hero__subtitle {
        font-size: 0.85rem;
    }

    .header__title {
        font-size: 0.9rem;
    }

    .header__subtitle {
        font-size: 0.65rem;
    }
}

/* Print styles */
@media print {
    .bottom-bar {
        display: none !important;
    }

    .header {
        position: static;
        box-shadow: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .lang-switcher,
    .form-actions,
    #exportPdfBtn,
    .calculator-section {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #d1d9e6;
        break-inside: avoid;
    }

    .results-section {
        display: block !important;
    }

    .schedule-table th {
        background: #1a3a5c !important;
        color: #ffffff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
