/* ========================================================
   MY RESERVATION – Stepper / Journey Page
   Extends style_license.css tokens & components
   ======================================================== */

/* ========= PROGRESS BAR ========= */
.progress-bar-container {
    background: #e9edf6;
    border-radius: var(--radius-xl);
    height: 10px;
    overflow: hidden;
    margin: 18px 0 8px;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-xl);
    background: linear-gradient(90deg, #42C6B6, #3FB9A4);
    transition: width .6s ease;
}

.progress-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
    margin-bottom: 4px;
}

/* ========= STATUS BADGE ========= */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.status-badge.in-progress {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.completed {
    background: #e0f7f1;
    color: #00695c;
}

/* ========= PAGE HEADER ========= */
.page-header {
    padding: 48px 0 32px;
}

.page-header h1 {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
}

.page-header p {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--muted);
    margin: 0;
}

/* ========= TWO-COLUMN LAYOUT ========= */
.journey-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 820px) {
    .journey-grid {
        grid-template-columns: 1.25fr .75fr;
    }
}

/* Left column wrapper for stacking cards */
.mr-left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========= INFO CARDS (Housemate, Emergency Contact) ========= */
.mr-info-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px 24px;
}

.mr-info-card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 16px;
}

.mr-info-card-body p {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--ink);
    line-height: 1.5;
}

.mr-info-card-body a {
    color: #1a6dd4;
    text-decoration: none;
    font-weight: 600;
}

.mr-info-card-body a:hover {
    text-decoration: underline;
}

/* Housemate items */
.mr-housemate-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border-left: 3px solid #25D366;
    padding: 14px 16px;
    border-radius: 0 12px 12px 0;
    background: rgba(92, 183, 172, .06);
    margin-bottom: 12px;
    position: relative;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.mr-housemate-item:hover {
    background: rgba(92, 183, 172, .12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 183, 172, 0.15);
}

a.mr-housemate-item:hover,
a.mr-housemate-item:focus {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 767px) {
    .mr-housemate-img {
        width: 70px;
        height: 70px;
    }

    .mr-housemate-wa {
        position: absolute;
        top: 10px;
        right: 10px;
        align-self: auto;
    }
}

.mr-housemate-item:last-child {
    margin-bottom: 0;
}

.mr-housemate-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.mr-housemate-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: #25D366 !important;
    font-size: 20px;
    flex-shrink: 0;
    align-self: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.mr-housemate-item:hover .mr-housemate-wa {
    background: rgba(37, 211, 102, .12);
    transform: scale(1.1);
}

.mr-housemate-item p {
    margin: 0 0 6px;
    font-size: 14px;
}

.mr-housemate-item p:last-child {
    margin-bottom: 0;
}

/* Alert boxes */
.mr-alert-warning {
    background: #fff3cd;
    border-left: 3px solid #e6a817;
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
    font-size: 14px;
    color: #664d03;
    margin: 14px 0;
    line-height: 1.5;
}

.mr-alert-info {
    background: #f0f7ff;
    border-left: 3px solid #1a6dd4;
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
    font-size: 14px;
    color: #333;
    margin: 14px 0 0;
    line-height: 1.7;
}

.mr-alert-info a {
    color: #1a6dd4;
    text-decoration: none;
    font-weight: 600;
}

.mr-alert-info a:hover {
    text-decoration: underline;
}

/* ========= SIDEBAR ========= */
.sidebar-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 22px;
}

.sidebar-card h4 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
}

.sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf0f6;
}

.sidebar-item:last-child {
    border-bottom: 0;
}

.sidebar-item .si-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.sidebar-item .si-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--muted);
}

.sidebar-item .si-value {
    font-weight: 800;
    color: var(--ink);
    font-size: 15px;
    margin-top: 2px;
}

.btn-contact {
    margin-top: 16px;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========= STEPPER (vertical by default) ========= */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding: 8px 0;
}

.stepper-step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0 16px;
    position: relative;
    min-height: 80px;
}

/* Connector line */
.stepper-step::before {
    content: "";
    position: absolute;
    left: 27px;
    /* center of 56px icon col */
    top: 56px;
    bottom: -1px;
    width: 3px;
    background: #e1e6f0;
    z-index: 0;
}

.stepper-step:last-child::before {
    display: none;
}

.stepper-step.completed::before {
    background: #42C6B6;
}

/* Icon circle */
.step-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
    z-index: 1;
    position: relative;
    transition: all .3s;
}

.stepper-step.completed .step-icon {
    background: #42C6B6;
    color: #fff;
    box-shadow: 0 6px 16px rgba(66, 198, 182, .3);
}

.stepper-step.active .step-icon {
    background: #173156;
    color: #fff;
    box-shadow: 0 6px 18px rgba(23, 49, 86, .3);
    animation: pulse-ring 2s ease infinite;
}

.stepper-step.pending .step-icon {
    background: #edf0f6;
    color: #9eaec4;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 49, 86, .35);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(23, 49, 86, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(23, 49, 86, 0);
    }
}

/* Step content */
.step-body {
    padding: 6px 0 24px;
}

.step-title {
    font-weight: 800;
    font-size: 17px;
    color: var(--ink);
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.step-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.step-badge.done {
    background: #e0f7f1;
    color: #00695c;
}

.step-badge.waiting {
    background: #fff3e0;
    color: #e65100;
}

.step-badge.issued {
    background: #e3f2fd;
    color: #1565c0;
}

.step-badge.read {
    background: #e0f7f1;
    color: #00695c;
}

.step-help {
    font-size: 14px;
    color: var(--muted);
    margin: 6px 0 10px;
    line-height: 1.5;
}

.step-cta .btn {
    font-size: 14px;
    padding: 9px 18px;
}

.step-cta .btn+.btn {
    margin-left: 8px;
}

/* When buttons stack in a column (license done step), reset the margin-left */
.step-cta[style*="flex-direction:column"] .btn+.btn,
.step-cta[style*="flex-direction: column"] .btn+.btn {
    margin-left: 0;
}

/* Waiting message (no CTA) */
.step-waiting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: #f7f9fd;
    border: 1px solid #e1e6f0;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.step-waiting i {
    animation: spin 1.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========= FINAL CTA ========= */
.final-cta {
    text-align: center;
    margin: 28px 0 8px;
}

.final-cta .btn {
    font-size: 16px;
    padding: 14px 28px;
}

/* ========= DESKTOP HORIZONTAL STEPPER (optional enhancement) ========= */
/* Keeping vertical for clarity; can switch to horizontal via class toggle */

/* ========= PRINT ========= */
@media print {
    .toolbar {
        display: none !important;
    }

    .sidebar-card,
    .card {
        box-shadow: none;
        border: 1px solid #e9edf6;
    }

    .stepper-step.active .step-icon {
        animation: none;
    }
}

/* ========= SMALL MOBILE ========= */
@media (max-width: 480px) {
    .stepper-step {
        grid-template-columns: 44px 1fr;
        gap: 0 12px;
    }

    .step-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .stepper-step::before {
        left: 20px;
        top: 44px;
    }

    .step-title {
        font-size: 15px;
    }

    .step-help {
        font-size: 13px;
    }
}

/* ========= MY-ROOM DARK NAVY SIDEBAR ========= */

/* Desktop sidebar column */
.mr-sidebar-col {
    display: none;
}

@media (min-width: 900px) {
    .mr-sidebar-col {
        display: block;
        align-self: start;
        position: sticky;
        top: 80px;
    }
}

.mr-sidebar-summary {
    background-color: #173156;
    color: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 10px 30px rgba(20, 35, 59, .18);
    border: 1px solid rgba(92, 183, 172, .2);
}

/* Property card inside sidebar */
.mr-property-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.mr-property-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.mr-property-info {
    flex: 1;
    min-width: 0;
}

.mr-property-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.mr-property-code {
    font-size: 13px;
    color: rgba(255, 255, 255, .55);
    margin-top: 2px;
}

.mr-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #fff;
}

.mr-stat-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.mr-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
}

.mr-label-grp {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: .5;
    font-weight: 600;
}

.mr-label-grp i {
    font-size: 13px;
    width: 18px;
    text-align: center;
}

.mr-value {
    text-align: right;
    font-weight: 700;
}

/* Contact button */
.mr-contact {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 20px;
}

.mr-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(92, 183, 172, .15);
    border: 1px solid rgba(92, 183, 172, .25);
    border-radius: 14px;
    color: #3FB9A4;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
}

.mr-contact-btn:hover {
    background: rgba(92, 183, 172, .25);
    text-decoration: none;
}

/* ========= MOBILE STICKY BAR ========= */

.mr-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;

    /* Fill the home-indicator gap with navy — works in both Safari & Chrome iOS.
       The wrapper's padding area gets the background color; content height stays the same. */
    background-color: #173156;
    padding-bottom: 0px;
    /* fallback for browsers without env() support */
    padding-bottom: env(safe-area-inset-bottom);

    /* GPU layer promotion: prevents the sticky bar from visually detaching
       from the screen edge when the mobile browser UI (address bar / bottom bar)
       animates in/out during scroll. By placing the element on its own
       compositor layer, the browser can slide the bar with its own UI
       instead of triggering a full layout repaint that causes the gap. */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;

    /* Backface visibility: extra hint for Safari to keep the layer stable */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

@media (min-width: 900px) {
    .mr-sticky-bar {
        display: none;
    }
}

/* Backdrop */
.mr-sticky-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: -1;
}

.mr-sticky-bar.expanded .mr-sticky-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Content container */
.mr-sticky-content {
    background-color: #173156;
    color: #fff;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border: 1px solid rgba(92, 183, 172, .2);
    border-bottom: none;
    overflow: hidden;
}

/* Collapsed state */
.mr-bar-collapsed {
    padding: 10px 24px;
}

.mr-drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, .2);
    border-radius: 20px;
    margin: 0 auto 8px;
    cursor: pointer;
}

.mr-collapsed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mr-collapsed-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #3FB9A4;
    letter-spacing: .1em;
    margin-bottom: 2px;
}

.mr-collapsed-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.mr-expand-btn {
    appearance: none;
    border: 1px solid rgba(92, 183, 172, .3);
    background: rgba(92, 183, 172, .12);
    color: #3FB9A4;
    border-radius: 14px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Expanded state */
.mr-bar-expanded {
    display: none;
    padding: 24px 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.mr-sticky-bar.expanded .mr-bar-collapsed {
    display: none;
}

.mr-sticky-bar.expanded .mr-bar-expanded {
    display: block;
}

.mr-sticky-handle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.mr-close-btn {
    appearance: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, .5);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.mr-close-btn:hover {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}