/* ==========================================================================
   RentKaro — layered on Bootstrap 5
   Palette: deep pine ink + rickshaw yellow. One bold moment (the rental tag);
   everything else stays quiet.
   ========================================================================== */

:root {
    --rk-ink:        #13322b;   /* headings, nav, primary buttons */
    --rk-ink-soft:   #2b4a42;
    --rk-yellow:     #f2b705;   /* the accent — used sparingly */
    --rk-yellow-dim: #fff4cf;
    --rk-paper:      #f7f8f6;   /* page background */
    --rk-line:       #dfe4e1;
    --rk-muted:      #5b6b66;
    --rk-red:        #c63d3d;
    --rk-green:      #1f7a4d;

    --rk-radius-sm: 6px;
    --rk-radius:    12px;

    --bs-body-font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-color: #1d2b27;
    --bs-body-bg: var(--rk-paper);
    --bs-link-color: var(--rk-ink);
    --bs-link-hover-color: #000;
    --bs-link-color-rgb: 19, 50, 43;
    --bs-link-hover-color-rgb: 0, 0, 0;
    --bs-border-color: var(--rk-line);
}

body { font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4, .rk-display {
    font-family: "Bricolage Grotesque", var(--bs-body-font-family);
    color: var(--rk-ink);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }

a { text-underline-offset: 3px; }
.text-muted, .rk-muted { color: var(--rk-muted) !important; }

:focus-visible { outline: 3px solid var(--rk-yellow); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--rk-radius-sm); font-weight: 600; padding: .6rem 1.1rem; }
.btn-rk {
    background: var(--rk-ink); color: #fff; border: 2px solid var(--rk-ink);
}
.btn-rk:hover, .btn-rk:focus { background: #0a201b; color: #fff; border-color: #0a201b; }
.btn-rk-outline { background: transparent; color: var(--rk-ink); border: 2px solid var(--rk-ink); }
.btn-rk-outline:hover { background: var(--rk-ink); color: #fff; }
.btn-rk-yellow { background: var(--rk-yellow); color: var(--rk-ink); border: 2px solid var(--rk-yellow); }
.btn-rk-yellow:hover { background: #dba502; border-color: #dba502; color: var(--rk-ink); }

/* ---------- Navbar ---------- */
.rk-nav { background: #fff; border-bottom: 1px solid var(--rk-line); }
.rk-brand {
    font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.45rem;
    color: var(--rk-ink) !important; letter-spacing: -0.03em; text-decoration: none;
    display: inline-flex; align-items: center; gap: .45rem;
}
.rk-brand-mark {
    width: 30px; height: 30px; border-radius: 8px; background: var(--rk-yellow);
    display: inline-grid; place-items: center; color: var(--rk-ink); font-size: 1rem;
}
.rk-nav .nav-link { color: var(--rk-ink); font-weight: 500; }
.rk-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--rk-ink); color: #fff;
    display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--rk-radius-sm); border: 1.5px solid #cfd6d3; padding: .65rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rk-ink); box-shadow: 0 0 0 3px rgba(242, 183, 5, .35);
}
.form-label { font-weight: 600; color: var(--rk-ink); margin-bottom: .35rem; }
.form-text { color: var(--rk-muted); }

/* ---------- Panels (not floating cards: flat, bordered) ---------- */
.rk-panel {
    background: #fff; border: 1px solid var(--rk-line); border-radius: var(--rk-radius);
    padding: 1.75rem;
}
.rk-auth { max-width: 460px; margin: 3rem auto; }
.rk-auth h1 { font-size: 1.9rem; }

/* ---------- Hero ---------- */
.rk-hero { background: var(--rk-ink); color: #e9efed; overflow: hidden; }
.rk-hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.9rem); max-width: 14ch; }
.rk-hero p.lead { color: #c6d3cf; max-width: 46ch; }
.rk-search {
    background: #fff; border-radius: var(--rk-radius); padding: .4rem; display: flex; gap: .4rem;
    max-width: 560px;
}
.rk-search input, .rk-search select { border: 0; box-shadow: none !important; }
.rk-search select { max-width: 150px; border-left: 1px solid var(--rk-line); border-radius: 0; }

/* The rental tag — the one bold element */
.rk-tag {
    position: relative; background: var(--rk-yellow); color: var(--rk-ink);
    border-radius: 14px 14px 14px 14px; padding: 1.6rem 1.6rem 1.4rem 2.6rem;
    max-width: 330px; transform: rotate(-4deg);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55);
}
.rk-tag::before { /* string hole */
    content: ""; position: absolute; left: 1rem; top: 50%; width: 14px; height: 14px;
    margin-top: -7px; border-radius: 50%; background: var(--rk-ink);
}
.rk-tag::after { /* perforation */
    content: ""; position: absolute; left: 2rem; top: 10px; bottom: 10px;
    border-left: 2px dashed rgba(19, 50, 43, .35);
}
.rk-tag-item { font-weight: 600; font-size: 1.05rem; }
.rk-tag-price { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 2.6rem; line-height: 1; }
.rk-tag-price small { font-size: 1rem; font-weight: 600; }
.rk-tag-row { display: flex; justify-content: space-between; border-top: 1px solid rgba(19,50,43,.25); padding-top: .5rem; margin-top: .75rem; font-size: .92rem; }
.rk-tag-verified { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
    .rk-tag { animation: rk-swing 1.2s cubic-bezier(.2,.7,.3,1) both; transform-origin: 1.4rem 50%; }
    @keyframes rk-swing { 0% { transform: rotate(-16deg); } 60% { transform: rotate(1deg); } 100% { transform: rotate(-4deg); } }
}

/* ---------- Categories ---------- */
.rk-cat {
    display: block; height: 100%; padding: 1.4rem; border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius); background: #fff; text-decoration: none; color: inherit;
}
.rk-cat:hover { border-color: var(--rk-ink); }
.rk-cat-icon { font-size: 1.8rem; color: var(--rk-ink); }
.rk-cat ul { list-style: none; padding: 0; margin: .75rem 0 0; color: var(--rk-muted); font-size: .93rem; }
.rk-cat li { padding: .15rem 0; }

/* ---------- Steps (a real sequence, so numbers are earned) ---------- */
.rk-step-num {
    width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--rk-ink);
    display: inline-grid; place-items: center; font-weight: 700; color: var(--rk-ink);
}

/* ---------- OTP boxes ---------- */
.rk-otp { display: flex; gap: .5rem; justify-content: center; }
.rk-otp input {
    width: 52px; height: 60px; text-align: center; font-size: 1.6rem; font-weight: 700;
    border: 1.5px solid #cfd6d3; border-radius: var(--rk-radius-sm); color: var(--rk-ink);
}
.rk-otp input:focus { border-color: var(--rk-ink); box-shadow: 0 0 0 3px rgba(242, 183, 5, .35); outline: none; }
@media (max-width: 400px) { .rk-otp input { width: 42px; height: 52px; font-size: 1.3rem; } }

/* ---------- Upload tiles ---------- */
.rk-upload {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 190px; border: 2px dashed #c3ccc8; border-radius: var(--rk-radius); background: #fff;
    text-align: center; padding: 1rem; cursor: pointer; overflow: hidden;
}
.rk-upload:hover, .rk-upload.has-file { border-color: var(--rk-ink); }
.rk-upload.is-invalid { border-color: var(--rk-red); }
.rk-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rk-upload img.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rk-upload .rk-upload-label { position: relative; z-index: 1; }
.rk-upload.has-file .rk-upload-label {
    background: rgba(19,50,43,.85); color: #fff; padding: .3rem .7rem; border-radius: 999px; font-size: .85rem;
    position: absolute; bottom: .6rem;
}
.rk-upload.has-file .rk-upload-hint, .rk-upload.has-file .rk-upload-icon { display: none; }
.rk-upload-icon { font-size: 2rem; color: var(--rk-ink); }

/* ---------- Status ---------- */
.rk-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.rk-badge-pending    { background: var(--rk-yellow-dim); color: #7a5b00; }
.rk-badge-approved   { background: #e1f3e9; color: var(--rk-green); }
.rk-badge-rejected   { background: #fbe6e6; color: var(--rk-red); }
.rk-badge-unverified { background: #eceff0; color: var(--rk-muted); }

.rk-notice { border-left: 4px solid var(--rk-yellow); background: #fff; padding: 1rem 1.25rem; border-radius: 0 var(--rk-radius-sm) var(--rk-radius-sm) 0; }
.rk-notice.is-red { border-left-color: var(--rk-red); }
.rk-notice.is-green { border-left-color: var(--rk-green); }

.alert { border-radius: var(--rk-radius-sm); }

/* ---------- Footer ---------- */
.rk-footer { border-top: 1px solid var(--rk-line); background: #fff; color: var(--rk-muted); font-size: .92rem; }
.rk-footer a { color: var(--rk-muted); text-decoration: none; }
.rk-footer a:hover { color: var(--rk-ink); }

/* ==========================================================================
   Admin
   ========================================================================== */
.rk-admin { display: flex; min-height: 100vh; }
.rk-sidebar { width: 240px; flex-shrink: 0; background: var(--rk-ink); color: #c6d3cf; padding: 1.25rem 1rem; }
.rk-sidebar .rk-brand { color: #fff !important; font-size: 1.25rem; }
.rk-sidebar .nav-link { color: #c6d3cf; border-radius: var(--rk-radius-sm); padding: .55rem .75rem; display: flex; align-items: center; gap: .6rem; }
.rk-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.rk-sidebar .nav-link.active { background: var(--rk-yellow); color: var(--rk-ink); font-weight: 600; }
.rk-sidebar .nav-link .badge { margin-left: auto; }
.rk-sidebar .nav-link.disabled { opacity: .45; }
.rk-admin-main { flex: 1; min-width: 0; padding: 2rem; }
@media (max-width: 991px) {
    .rk-admin { flex-direction: column; }
    .rk-sidebar { width: 100%; }
    .rk-admin-main { padding: 1.25rem; }
}

.rk-stat { background: #fff; border: 1px solid var(--rk-line); border-radius: var(--rk-radius); padding: 1.1rem 1.25rem; height: 100%; }
.rk-stat-value { font-family: "Bricolage Grotesque", sans-serif; font-size: 2rem; font-weight: 800; color: var(--rk-ink); line-height: 1.1; }
.rk-stat-label { color: var(--rk-muted); font-size: .9rem; }
.rk-stat.is-urgent { border-color: var(--rk-yellow); background: var(--rk-yellow-dim); }

.rk-table { background: #fff; border: 1px solid var(--rk-line); border-radius: var(--rk-radius); overflow: hidden; }
.rk-table table { margin: 0; }
.rk-table th { font-size: .82rem; color: var(--rk-muted); font-weight: 600; background: #fafbfa; }
.rk-table td, .rk-table th { padding: .8rem 1rem; vertical-align: middle; }

.rk-tabs .nav-link { color: var(--rk-muted); font-weight: 600; border: 0; border-bottom: 3px solid transparent; border-radius: 0; }
.rk-tabs .nav-link.active { color: var(--rk-ink); border-bottom-color: var(--rk-yellow); background: none; }

.rk-doc { background: #fff; border: 1px solid var(--rk-line); border-radius: var(--rk-radius); overflow: hidden; }
.rk-doc-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #20302b; cursor: zoom-in; }
.rk-doc-caption { padding: .6rem .9rem; font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; align-items: center; }

.rk-dl dt { color: var(--rk-muted); font-weight: 500; font-size: .88rem; }
.rk-dl dd { font-weight: 600; margin-bottom: .9rem; }

/* ==========================================================================
   Milestone 2: listings
   ========================================================================== */
.rk-verified { display: inline-flex; align-items: center; gap: .3rem; color: var(--rk-green); font-weight: 600; font-size: .88rem; }
.rk-verified i { font-size: 1rem; }

/* Listing card: photo, then the price tag strip */
.rk-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--rk-line); border-radius: var(--rk-radius); overflow: hidden; color: inherit; text-decoration: none; }
.rk-card:hover { border-color: var(--rk-ink); color: inherit; }
.rk-card-img { aspect-ratio: 4 / 3; background: #eef1ef; display: grid; place-items: center; overflow: hidden; }
.rk-card-img img { width: 100%; height: 100%; object-fit: cover; }
.rk-card-img .bi { font-size: 2.2rem; color: #b5c0bc; }
.rk-card-body { padding: .8rem .9rem .9rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.rk-card-title { font-weight: 600; color: var(--rk-ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-card-place { color: var(--rk-muted); font-size: .85rem; }
.rk-card-price { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.rk-card-price strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.2rem; color: var(--rk-ink); }
.rk-card-deposit { font-size: .82rem; background: var(--rk-yellow-dim); color: #6b5000; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }

/* Browse filters */
.rk-filters .form-label { font-size: .88rem; }
.rk-filters .rk-cat-link { display: block; padding: .2rem 0; color: var(--rk-ink); text-decoration: none; font-size: .93rem; }
.rk-filters .rk-cat-link.is-sub { padding-left: 1rem; color: var(--rk-muted); }
.rk-filters .rk-cat-link.active { font-weight: 700; color: var(--rk-ink); }
.rk-filters .rk-cat-link:hover { text-decoration: underline; }

/* Listing page */
.rk-gallery-main { aspect-ratio: 4 / 3; background: #20302b; border-radius: var(--rk-radius); overflow: hidden; display: grid; place-items: center; }
.rk-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.rk-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem 0 .2rem; }
.rk-thumbs button { flex: 0 0 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: var(--rk-radius-sm); overflow: hidden; background: #eef1ef; }
.rk-thumbs button.active { border-color: var(--rk-yellow); }
.rk-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.rk-book { position: sticky; top: 1rem; }
.rk-book-price { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 2.2rem; color: var(--rk-ink); line-height: 1; }
.rk-book-row { display: flex; justify-content: space-between; padding: .55rem 0; border-top: 1px solid var(--rk-line); }
.rk-owner { display: flex; gap: .8rem; align-items: center; }
.rk-owner .rk-avatar { width: 48px; height: 48px; font-size: 1rem; }
.rk-description { white-space: pre-line; }

/* Listing form */
.rk-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.rk-photo { position: relative; aspect-ratio: 1; border-radius: var(--rk-radius-sm); overflow: hidden; background: #eef1ef; border: 1px solid var(--rk-line); }
.rk-photo img { width: 100%; height: 100%; object-fit: cover; }
.rk-photo .rk-photo-tag { position: absolute; top: .35rem; left: .35rem; background: var(--rk-yellow); color: var(--rk-ink); font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; }
.rk-photo .rk-photo-actions { position: absolute; inset: auto 0 0 0; display: flex; gap: .25rem; padding: .3rem; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.rk-photo .rk-photo-actions button { flex: 1; font-size: .72rem; padding: .2rem; border: 0; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--rk-ink); }
.rk-photo .rk-photo-actions button.is-danger { color: var(--rk-red); }
.rk-add-photos { min-height: 120px; }
.rk-hint { background: var(--rk-yellow-dim); border-radius: var(--rk-radius-sm); padding: .6rem .8rem; font-size: .9rem; }

.rk-mylisting { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-top: 1px solid var(--rk-line); }
.rk-mylisting:first-child { border-top: 0; }
.rk-mylisting-img { width: 88px; height: 66px; border-radius: var(--rk-radius-sm); overflow: hidden; flex-shrink: 0; background: #eef1ef; display: grid; place-items: center; }
.rk-mylisting-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 575px) {
    .rk-mylisting { flex-wrap: wrap; }
    .rk-mylisting-actions { width: 100%; }
}

/* ==========================================================================
   Milestone 3: bookings
   ========================================================================== */
.rk-code {
    display: inline-block; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 2.4rem;
    letter-spacing: .3em; padding: .4rem .5rem .4rem .8rem; background: var(--rk-yellow); color: var(--rk-ink);
    border-radius: var(--rk-radius-sm); line-height: 1.1;
}

.rk-chat { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.rk-msg { max-width: 82%; align-self: flex-start; }
.rk-msg.is-mine { align-self: flex-end; text-align: right; }
.rk-msg-body { display: inline-block; text-align: left; white-space: pre-line; background: #eef1ef; padding: .55rem .8rem; border-radius: 12px 12px 12px 4px; }
.rk-msg.is-mine .rk-msg-body { background: var(--rk-ink); color: #fff; border-radius: 12px 12px 4px 12px; }
.rk-msg-meta { font-size: .75rem; color: var(--rk-muted); margin-top: .15rem; }

/* Star rating: radios in reverse order so CSS can light up the hovered star and those before it */
.rk-stars { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.rk-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rk-stars label { font-size: 1.6rem; color: #d3d9d6; cursor: pointer; }
.rk-stars input:checked ~ label, .rk-stars label:hover, .rk-stars label:hover ~ label { color: var(--rk-yellow); }
.rk-stars input:focus-visible + label { outline: 3px solid var(--rk-yellow); outline-offset: 2px; border-radius: 4px; }
