h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1.25rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================================
   Rentpa design system
   ============================================================ */
:root {
    --navy: #0d3b66;
    --ocean: #1769aa;
    --sky: #2a9fd6;
    --bg: #f1f6fb;
    --surface: #ffffff;
    --ink: #16242f;
    --muted: #5f7387;
    --line: #e2e9f0;
    --danger: #b32121;
    --ok: #1a7f37;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(13, 59, 102, .08), 0 4px 16px rgba(13, 59, 102, .06);
    --shadow-hover: 0 6px 24px rgba(13, 59, 102, .14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 1.5rem 0 0.6rem; letter-spacing: -0.01em; }
h3 { font-size: 1.08rem; margin: 0 0 0.5rem; }
h1, h2, h3 { color: var(--navy); }

a { color: var(--ocean); }

.muted { color: var(--muted); font-size: 0.9rem; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.6rem 1.15rem;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .05s;
    line-height: 1.1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--ocean), var(--sky));
    color: #fff;
    box-shadow: 0 2px 8px rgba(23, 105, 170, .3);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(23, 105, 170, .42); }
.btn-primary:disabled {
    background: #aab8c4;
    box-shadow: none;
    cursor: not-allowed;
}
.btn-secondary {
    background: #e7eef5;
    color: var(--navy);
}
.btn-secondary:hover { background: #d6e2ee; }

/* ---- Cards ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.1rem;
    margin-top: 1.25rem;
}
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
    transition: box-shadow .18s, transform .18s;
}
.card-grid .card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.card h3 { margin-top: 0; }

.price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
}

/* ---- Forms ---- */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    max-width: 480px;
}
.form-row label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}
.form-row input,
.form-row textarea,
.form-row select,
input[type=date],
input[type=time],
input[type=datetime-local],
select {
    padding: 0.7rem 0.8rem;
    border: 1px solid #c4d0dc;
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
    min-height: 44px;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(42, 159, 214, .18);
}

/* ---- Alerts ---- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border: 1px solid transparent;
}
.alert-error { background: #fde8e8; color: #6e1414; border-color: #f5c2c2; }
.alert-success { background: #e3f7e8; color: #115c2a; border-color: #b6e6c4; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data th, table.data td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data th { background: #eef3f8; color: var(--navy); font-size: 0.9rem; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f6f9fc; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.badge-pending { background: #fff3cd; color: #7a5b00; }
.badge-paid    { background: #d4edda; color: #155724; }
.badge-cancel  { background: #f8d7da; color: #721c24; }

/* ---- Card thumbnail ---- */
.card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, #dcebf7, #c2ddf0);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder { font-size: 3rem; opacity: .55; }
.type-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(13, 59, 102, .88);
    color: #fff;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ---- Carousel ---- */
.carousel { margin: 1rem 0 1.5rem; max-width: 760px; }
.carousel-empty {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #dcebf7, #c2ddf0);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.carousel-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--navy);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.carousel-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-nav:hover { background: rgba(0, 0, 0, .72); }
.carousel-nav.prev { left: 0.6rem; }
.carousel-nav.next { right: 0.6rem; }
.carousel-counter {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.carousel-dots { display: flex; gap: 0.4rem; justify-content: center; margin-top: 0.65rem; }
.carousel-dots .dot {
    width: 11px; height: 11px; border-radius: 50%;
    border: none; background: #c1ccd6; padding: 0; cursor: pointer;
}
.carousel-dots .dot.active { background: var(--ocean); }

/* ---- Image manager ---- */
.image-manager { margin-top: 1rem; }
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0;
}
.image-tile {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #e1e8ef;
    aspect-ratio: 4 / 3;
}
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile .remove-btn {
    position: absolute; top: 0.4rem; right: 0.4rem;
    padding: 0.25rem 0.55rem; font-size: 0.8rem; min-height: 0;
}
.image-upload { margin-top: 0.75rem; }
.image-upload label.btn { cursor: pointer; }

/* ---- Type filter ---- */
.type-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.25rem; }
.type-filter button {
    border: 1px solid #c4d0dc;
    background: #fff;
    color: var(--navy);
    padding: 0.55rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    min-height: 44px;
}
.type-filter button:hover { background: #eef3f8; }
.type-filter button.active {
    background: var(--ocean);
    color: #fff;
    border-color: var(--ocean);
}

/* ---- Brand/model admin ---- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.brand-card { padding: 1rem; }
.brand-header {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);
}
.brand-header .actions { margin-left: auto; display: flex; gap: 0.4rem; }
.model-list { list-style: none; margin: 0; padding: 0; }
.model-list li {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0; border-bottom: 1px dashed #eef1f5;
}
.model-list li .actions { margin-left: auto; display: flex; gap: 0.4rem; }
.model-list li.add-model { border-bottom: none; padding-top: 0.5rem; }
.inline-input {
    flex: 1; padding: 0.45rem 0.6rem; border: 1px solid #c4d0dc;
    border-radius: 8px; font: inherit; min-width: 0;
}
.btn-link {
    background: none; border: none; color: var(--ocean);
    cursor: pointer; padding: 0.25rem; font: inherit; text-decoration: underline;
}
.btn-link:hover { color: var(--navy); }
.btn-link.btn-danger { color: var(--danger); }
.btn-xs { padding: 0.35rem 0.65rem; font-size: 0.85rem; min-height: 0; border-radius: 8px; }

.password-display {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    user-select: all;
}
.generated-password { max-width: 600px; }

/* ---- Booking form ---- */
.booking-form {
    background: var(--surface);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 520px;
}

/* ---- Owner payout callout ---- */
.payout-next {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    background: #e2f0fb;
    border: 1px solid #b9d8ef;
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin: 0.75rem 0;
}

/* ---- Checkout / Paytrail ---- */
.checkout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.4fr);
    gap: 1.5rem;
    align-items: start;
}
.checkout-summary, .checkout-payment {
    background: var(--surface);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
    margin: 0.5rem 0 1.25rem;
}
.provider-form { margin: 0; }
.provider-btn {
    width: 100%;
    height: 56px;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
.provider-btn:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.provider-btn img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 720px) {
    .checkout { grid-template-columns: 1fr; }
}

/* ---- Availability calendar ---- */
.availability-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.availability-grid {
    border-collapse: collapse;
    width: 100%;
    min-width: 560px;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.availability-grid th, .availability-grid td {
    padding: 0.35rem 0.4rem;
    text-align: center;
    font-size: 0.82rem;
    border: 1px solid var(--line);
    min-width: 42px;
}
.availability-grid thead th { background: #eef3f8; color: var(--navy); }
.availability-grid tbody th { background: #f7f9fc; color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.cal-cell.available { background: #e2f4e8; cursor: pointer; }
.cal-cell.available:hover { background: #aee0bd; }
.cal-cell.booked { background: #fbdcdf; color: #7a1414; cursor: not-allowed; }
.cal-cell.blocked { background: #d9dde1; color: #555; cursor: not-allowed; }
.cal-cell.past { background: #f4f6f8; color: #b0b8c0; cursor: not-allowed; }
.cal-legend {
    display: inline-block; width: 14px; height: 14px;
    border-radius: 3px; vertical-align: middle; margin: 0 0.2rem;
}
.cal-legend.available { background: #e2f4e8; border: 1px solid #aee0bd; }
.cal-legend.booked    { background: #fbdcdf; border: 1px solid #f1aab0; }
.cal-legend.blocked   { background: #d9dde1; border: 1px solid #b6b6b6; }
.cal-legend.past      { background: #f4f6f8; border: 1px solid #d6dce2; }

/* ---- Blackout form ---- */
.blackout-form {
    background: var(--surface);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 520px;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    h1 { font-size: 1.5rem; }
    table.data { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .form-row { max-width: 100%; }
    .booking-form, .blackout-form { padding: 1rem; }
    .price { font-size: 1.2rem; }
}
