/* =====================================================
   Public-facing Rental Manager styles
   ===================================================== */

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

/* ===== Lightweight public media galleries ===== */
.property-card-image,
.property-card-cover,
.public-card-image-link,
.unit-select-cover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 9px;
}

.property-card-image {
    aspect-ratio: 16 / 10;
    margin-bottom: 14px;
    overflow: hidden;
    background: #e5e7eb;
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-card-cover,
.unit-select-cover {
    margin-bottom: 12px;
}

.property-availability {
    margin: 0 0 16px;
    color: #166534;
    font-size: 14px;
    font-weight: 700;
}

.property-card-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.public-detail-header,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.public-detail-header h1 {
    margin: 5px 0;
    color: #111827;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.15;
}

.public-detail-header p,
.section-heading p {
    color: #6b7280;
}

.public-back-link {
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.public-gallery {
    margin-bottom: 30px;
}

.public-gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #111827;
    aspect-ratio: 8 / 5;
}

.public-gallery-main > img,
.public-gallery-main > video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.public-gallery-main > video {
    object-fit: contain;
}

/* Property detail uses a banner-like preview instead of allowing the shared
   gallery aspect ratio to create a 700px+ block on wide screens. */
.property-detail-gallery {
    width: 100%;
    max-width: 1080px;
    margin-right: auto;
    margin-left: auto;
}

.property-detail-gallery .public-gallery-main {
    width: 100%;
    height: clamp(360px, 42vw, 500px);
    max-height: 500px;
    aspect-ratio: auto;
}

.property-detail-gallery .public-gallery-main > img {
    object-position: center 45%;
}

.public-gallery-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 0;
    padding: 26px 18px 12px;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.68));
    pointer-events: none;
}

.public-gallery-caption:empty {
    display: none;
}

.public-gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 12px 2px 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.gallery-thumbnail {
    position: relative;
    width: 116px;
    min-width: 116px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 9px;
    background: #dbe5f1;
    cursor: pointer;
}

.gallery-thumbnail.is-active {
    border-color: #2563eb;
}

.gallery-thumbnail img,
.gallery-video-tile {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gallery-video-tile {
    background: linear-gradient(135deg, #dbe5f1, #b9cbe0);
}

.gallery-thumbnail .media-play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    padding-left: 2px;
    border-radius: 50%;
    color: #fff;
    background: rgba(17, 24, 39, .78);
    font-size: 13px;
    pointer-events: none;
}

.public-description-card,
.public-unit-summary {
    margin: 25px 0;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.public-description-card h2,
.public-units-section h2 {
    margin-bottom: 10px;
    color: #111827;
}

.public-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.public-unit-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: #fff;
}

.public-card-image-link {
    border-radius: 0;
    overflow: hidden;
}

.public-card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-unit-card-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px;
}

.availability-label {
    align-self: flex-start;
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
    font-size: 12px;
    font-weight: 800;
}

.public-unit-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.public-unit-summary > div {
    display: flex;
    flex-direction: column;
}

.summary-label,
.unit-preview-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.public-detail-cta {
    display: flex;
    justify-content: center;
    padding: 20px 0 5px;
}

.unit-inline-thumbnails {
    display: flex;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
}

.unit-inline-thumbnail {
    position: relative;
    width: 66px;
    min-width: 66px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #dbe5f1;
    cursor: zoom-in;
}

.unit-inline-thumbnail img,
.inline-video-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inline-play-icon {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-shadow: 0 1px 4px #000;
}

.unit-media-dialog {
    width: min(920px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    margin: auto;
    padding: 12px;
    border: 0;
    border-radius: 14px;
    background: #111827;
    color: #fff;
}

.unit-media-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
}

.unit-media-dialog img,
.unit-media-dialog video {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 9px;
}

.dialog-close {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .68);
    font-size: 27px;
    cursor: pointer;
}

.unit-media-dialog p {
    padding: 8px 5px 2px;
}

@media (max-width: 640px) {
    .public-main {
        padding-inline: 14px;
    }

    .properties-grid,
    .public-unit-grid {
        grid-template-columns: 1fr;
    }

    .public-gallery-main {
        border-radius: 11px;
        aspect-ratio: 4 / 3;
    }

    .property-detail-header {
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }

    .property-detail-header .btn {
        width: 100%;
    }

    .property-detail-gallery .public-gallery-main {
        height: clamp(220px, 60vw, 280px);
        max-height: 280px;
        aspect-ratio: auto;
    }

    .property-detail-gallery .public-gallery-thumbnails {
        gap: 8px;
        padding-top: 9px;
    }

    .property-detail-gallery .gallery-thumbnail {
        width: 92px;
        min-width: 92px;
    }

    .public-unit-summary {
        grid-template-columns: 1fr;
    }

    .property-card-actions .btn {
        flex: 1;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .property-detail-gallery .public-gallery-main {
        height: clamp(320px, 46vw, 400px);
        max-height: 400px;
        aspect-ratio: auto;
    }
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    -webkit-font-smoothing: antialiased;
}

/* Public Header */
.public-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.public-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.public-brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    display: block;
}

.public-brand:hover {
    color: #2563eb;
}

.public-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.public-nav a {
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.public-nav a:hover {
    color: #111827;
    background: #f3f4f6;
}

/* Main Content */
.public-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 64px);
}

/* Hero Section */
.public-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: #ffffff;
    padding: 38px 24px;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 28px;
}

.public-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.public-hero-logo-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.public-hero-logo {
    max-height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.public-hero h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.public-hero p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 20px;
    font-weight: 400;
}

.public-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-secondary:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-light {
    background: #f3f4f6;
    color: #374151;
}

.btn-light:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-full {
    width: 100%;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.page-header p {
    color: #6b7280;
    font-size: 15px;
    margin-top: 4px;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.card-header p {
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

.card-body {
    padding: 8px 0;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

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

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-input,
.public-select,
select.form-input,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="tel"],
textarea {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    height: 50px;
    line-height: 1.4;
}

textarea {
    height: auto;
    min-height: 80px;
    padding: 12px 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-error {
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
}

/* Custom select */
.select-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.public-select,
.select-wrapper select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    cursor: pointer;
}

.public-select:required:invalid {
    color: #6b7280;
}

.public-select option {
    color: #111827;
}

.public-select option[value=""] {
    color: #6b7280;
}

/* Properties Grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
}

.public-section-heading {
    margin-bottom: 16px;
}

.public-section-heading h2 {
    margin-bottom: 4px;
    color: #111827;
    font-size: 22px;
    font-weight: 700;
}

.public-section-heading p {
    color: #6b7280;
    font-size: 14px;
}

.property-card.home-property-card {
    display: flex;
    overflow: hidden;
    padding: 0;
    flex-direction: column;
}

.home-property-card .property-card-image {
    flex: none;
    margin: 0;
    border-radius: 0;
}

.home-property-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
}

.home-property-card-body .btn {
    align-self: flex-start;
    margin-top: auto;
}

.property-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #bfdbfe;
}

.property-card-header {
    margin-bottom: 12px;
}

.property-card-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.property-card-header small {
    color: #6b7280;
    font-size: 14px;
}

.property-card p {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Unit Cards */
.unit-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.unit-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.unit-info h4 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.unit-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.unit-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-muted {
    background: #f3f4f6;
    color: #4b5563;
}

/* Progress Steps */
.application-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.step-number.active {
    background: #2563eb;
    color: #ffffff;
}

.step-number.completed {
    background: #d1fae5;
    color: #065f46;
}

.step-number.pending {
    background: #f3f4f6;
    color: #6b7280;
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.step-connector {
    width: 32px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 10px;
    flex-shrink: 0;
}

/* Reference Box */
.reference-box {
    background: #eff6ff;
    border: 2px dashed #2563eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.05em;
    display: inline-block;
    margin: 16px 0;
}

/* Success Icon */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    margin: 0 auto 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state p {
    font-size: 16px;
}

/* Selection Summary */
.selection-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.selection-summary h3 {
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .label {
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.summary-item .value {
    font-size: 15px;
    font-weight: 600;
    color: #0c4a6e;
}

/* Compact form sections */
.form-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.form-section-header {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Readonly field display */
.readonly-field {
    padding: 10px 0;
    font-size: 15px;
    color: #111827;
    font-weight: 500;
}

.readonly-field .readonly-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

/* Compact file upload */
.file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.15s ease;
}

.file-upload:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.file-upload input[type="file"] {
    display: block;
    margin: 8px auto 0;
    font-size: 14px;
}

.file-upload-hint {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.file-upload-name {
    font-size: 14px;
    color: #2563eb;
    font-weight: 600;
    margin-top: 6px;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* Unit select cards */
.unit-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.unit-select-option {
    display: block;
    min-width: 0;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.unit-select-option:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.unit-select-option input[type="radio"] {
    accent-color: #2563eb;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.unit-select-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    display: block;
    margin-bottom: 4px;
}

.unit-select-meta {
    font-size: 13px;
    color: #6b7280;
}

.unit-select-price {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-top: 6px;
}

/* Responsive helpers */
@media (max-width: 480px) {
    .public-hero h1 {
        font-size: 24px;
    }

    .public-hero-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }

    .reference-box {
        font-size: 18px;
        padding: 16px;
    }

    .unit-select-grid {
        grid-template-columns: 1fr;
    }
}

/* Filters */
.filter-card {
    padding: 16px 20px;
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form select {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    min-width: 180px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.stat-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.empty-table {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-style: italic;
}

.text-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.tenant-name-link {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}

.tenant-name-link:hover {
    color: #2563eb;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .public-header-inner {
        flex-direction: column;
        gap: 10px;
        padding: 10px 16px;
    }

    .public-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .public-nav a {
        font-size: 13px;
        padding: 5px 10px;
    }

    .public-main {
        padding: 16px;
    }

    .public-hero {
        padding: 28px 20px;
        border-radius: 12px;
        margin-bottom: 24px;
    }

    .public-hero h1 {
        font-size: 26px;
    }

    .public-hero p {
        font-size: 14px;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 15px;
    }

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

    .page-header h1 {
        font-size: 20px;
    }

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

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

    .unit-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .application-progress {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }

    .step-connector {
        display: none;
    }

    .step-label {
        font-size: 12px;
    }

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

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

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 8px;
    }

    .selection-summary {
        padding: 14px;
    }

    .card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .public-hero h1 {
        font-size: 26px;
    }

    .public-hero-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }

    .reference-box {
        font-size: 18px;
        padding: 16px;
    }
}

/* ===== Toast notifications ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 32px);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    animation: toast-in 0.25s ease-out;
}

.toast.toast-exit {
    animation: toast-out 0.2s ease-in forwards;
}

.toast-success {
    border-left: 4px solid #16a34a;
}

.toast-error {
    border-left: 4px solid #dc2626;
}

.toast-warning {
    border-left: 4px solid #d97706;
}

.toast-info {
    border-left: 4px solid #2563eb;
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon {
    background: #dcfce7;
    color: #166534;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #991b1b;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #92400e;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #1e40af;
}

.toast-body {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #374151;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}
.amenity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.amenity-chip {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eef6f8;
    color: #155e75;
    font-size: 13px;
    font-weight: 600;
}

.terms-review-card {
    padding: 18px;
    border: 1px solid #dbe5ee;
    border-radius: 12px;
    background: #f8fafc;
}

.terms-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 14px 0 8px;
    font-weight: 600;
}

.terms-content { white-space: normal; }

/* ===== Sub-phase 8B: public property and unit experience ===== */
.public-header-inner,
.public-main {
    width: 100%;
    max-width: 1240px;
}

.properties-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.property-card,
.public-unit-card {
    min-width: 0;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.property-card.home-property-card {
    padding: 0;
}

.property-card-image,
.public-card-image-link {
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
}

.property-card-image img,
.public-card-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-property-card-body {
    gap: 14px;
    padding: 20px;
}

.property-card-header {
    margin: 0;
}

.property-card-header h3 {
    line-height: 1.25;
}

.property-card-header h3 a {
    color: inherit;
    text-decoration: none;
}

.property-location,
.detail-location {
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.property-address,
.detail-address {
    overflow-wrap: anywhere;
    color: #64748b;
}

.home-property-card-body .property-address {
    min-height: 42px;
    margin: 0;
}

.property-card-amenities,
.unit-card-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.property-card-amenities .amenity-chip,
.unit-card-amenities .amenity-chip {
    padding: 5px 8px;
    font-size: 12px;
}

.amenity-chip-more {
    color: #475569;
    background: #f1f5f9;
}

.property-card-facts {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
}

.property-card-facts strong {
    color: #0f172a;
    font-size: 16px;
}

.home-property-card-body .btn {
    align-self: stretch;
    min-height: 46px;
}

.public-unit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.public-unit-card {
    display: flex;
    flex-direction: column;
}

.public-unit-card-body {
    flex: 1;
    gap: 12px;
    padding: 18px;
}

.unit-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.unit-card-heading h3 {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 19px;
}

.unit-card-meta {
    color: #64748b;
    font-size: 14px;
}

.unit-card-price {
    margin-top: auto;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.unit-card-price small {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.unit-card-actions,
.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.unit-card-actions .btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
}

.detail-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .properties-grid,
    .public-unit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .properties-grid,
    .public-unit-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-main {
        padding: 18px 14px 28px;
    }

    .public-header-inner {
        flex-direction: row;
        gap: 8px;
        padding: 9px 12px;
    }

    .public-brand {
        flex: 0 0 auto;
        font-size: 18px;
    }

    .public-nav {
        width: auto;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 2px;
    }

    .public-nav a {
        min-height: 40px;
        padding: 9px 5px;
        font-size: 12px;
        white-space: nowrap;
    }

    .public-detail-header {
        align-items: stretch;
    }

    .detail-header-actions,
    .detail-header-actions .btn {
        width: 100%;
    }

    .unit-card-actions {
        flex-direction: column;
    }

    .unit-card-actions .btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .public-header-inner {
        padding-inline: 10px;
    }

    .public-brand {
        font-size: 17px;
    }

    .public-nav a {
        padding-inline: 4px;
        font-size: 11px;
    }

    .home-property-card-body,
    .public-unit-card-body {
        padding: 16px;
    }
}
