/* ============ SweepSwap.Me — client app (mobile-first) ============ */

:root {
    --bs-primary: #14b8a6;
    --bs-primary-rgb: 20, 184, 166;
    --ss-ink: #0b1f1d;
    --ss-muted: #4b5e5b;
    --ss-cream: #f6f9f8;
    --ss-radius: 1rem;
    --ss-radius-lg: 1.5rem;
    --ss-shadow-soft: 0 12px 28px -16px rgba(15, 118, 110, 0.35);
    --ss-shadow-elevated: 0 24px 48px -24px rgba(15, 118, 110, 0.45);
    --tab-bar-height: 72px;
    --header-height: 60px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    color: var(--ss-ink);
    background: var(--ss-cream);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overscroll-behavior-y: none;
}

a { color: #0f766e; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ App shell ============ */

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    box-shadow: 0 0 60px -10px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-content {
    flex: 1;
    padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px));
}

/* ============ Page header ============ */

.page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 1rem 1.25rem;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
    letter-spacing: -0.01em;
}

.page-header .icon-btn {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--ss-cream);
    color: var(--ss-ink);
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    transition: background 0.15s ease;
}
.page-header .icon-btn:hover { background: #e9efee; }
.page-header .icon-btn:focus { outline: 2px solid #5eead4; outline-offset: 1px; }

/* ============ Page sections ============ */

.page-section {
    padding: 1.25rem;
}

.page-section--tight { padding: 0.75rem 1.25rem; }

.page-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--ss-ink);
    letter-spacing: -0.01em;
}

.page-section-link {
    font-size: 0.85rem;
    color: #0f766e;
    font-weight: 600;
}

/* ============ Hero block (Home) ============ */

.hero-block {
    background: #14b8a6;
    color: #fff;
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 0 0 24px 24px;
}
.hero-block h1 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.01em;
}
.hero-block .greeting {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin: 0 0 0.25rem;
}
.hero-block .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.hero-block .bell-btn {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}
.hero-block .bell-btn .count-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: #f59e0b;
    color: #1f2937;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============ Search bar ============ */

.search-bar {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    color: var(--ss-ink);
    box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.15);
    font-size: 0.92rem;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    display: block;
}
.search-bar::before {
    content: '\f52a';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ss-muted);
    font-size: 0.95rem;
}
.search-bar.is-input {
    cursor: text;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.92rem;
    color: inherit;
    width: 100%;
    padding: 0;
}

/* ============ Category pills ============ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.category-tile {
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--ss-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.15s ease;
    width: 100%;
}
.category-tile:active { transform: scale(0.95); }
.category-tile:hover { text-decoration: none; color: var(--ss-ink); }
.category-tile .icon-wrap {
    width: 48px; height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 1.25rem;
}
.category-tile .label {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    display: block;
}

/* Per-category pastel colors (mirror Lovable prototype) */
.cat-color-primary { background: rgba(20, 184, 166, 0.1);   color: #0f766e; }
.cat-color-blue    { background: #eff6ff;                    color: #2563eb; }
.cat-color-sky     { background: #f0f9ff;                    color: #0284c7; }
.cat-color-amber   { background: #fffbeb;                    color: #d97706; }
.cat-color-rose    { background: #fff1f2;                    color: #e11d48; }
.cat-color-orange  { background: #fff7ed;                    color: #ea580c; }
.cat-color-violet  { background: #f5f3ff;                    color: #7c3aed; }
.cat-color-emerald { background: #ecfdf5;                    color: #059669; }

/* ============ Initials logo (replaces cover images) ============ */
.logo-box {
    background: var(--ss-cream);
    color: rgba(15, 23, 42, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    border-radius: 12px;
}
.logo-box.sm { width: 40px; height: 40px; font-size: 0.8rem; border-radius: 10px; }
.logo-box.md { width: 56px; height: 56px; font-size: 1.1rem; }
.logo-box.lg { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 16px; }
.logo-box.xl { width: 100%; height: 192px; font-size: 3rem; border-radius: 0; }

/* ============ Promo banner (Home) ============ */
.promo-banner {
    background: linear-gradient(90deg, #0d9488 0%, rgba(13, 148, 136, 0.8) 100%);
    color: #fff;
    padding: 1.25rem;
    border-radius: var(--ss-radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.promo-banner i { font-size: 1.6rem; flex-shrink: 0; margin-top: 0.1rem; }
.promo-banner .pb-title { font-weight: 600; margin: 0; font-size: 0.95rem; }
.promo-banner .pb-desc { font-size: 0.85rem; opacity: 0.85; margin: 0.1rem 0 0; }
.promo-banner .pb-cta {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.promo-banner .pb-cta:hover { background: rgba(255, 255, 255, 0.3); color: #fff; text-decoration: none; }

/* ============ Mini company card (h-scroll) ============ */
.mini-card {
    flex: 0 0 200px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--ss-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mini-card:hover { box-shadow: var(--ss-shadow-soft); text-decoration: none; color: inherit; }
.mini-card:active { transform: scale(0.97); }
.mini-card .mini-logo {
    height: 96px;
    background: var(--ss-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.3);
}
.mini-card .mini-body { padding: 0.75rem; }
.mini-card .mini-name {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 0.25rem;
}
.mini-card .mini-meta {
    font-size: 0.7rem;
    color: var(--ss-muted);
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.mini-card .mini-price {
    font-size: 0.7rem;
    color: var(--ss-muted);
    margin: 0.3rem 0 0;
}

/* ============ Row company card (Blisko Ciebie + Szukaj results) ============ */
.row-card {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--ss-radius);
    padding: 0.85rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.row-card:hover { box-shadow: var(--ss-shadow-soft); text-decoration: none; color: inherit; }
.row-card:active { transform: scale(0.98); }
.row-card .rc-body { flex: 1; min-width: 0; }
.row-card .rc-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.92rem;
    margin: 0 0 0.15rem;
}
.row-card .rc-meta {
    font-size: 0.72rem;
    color: var(--ss-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
.row-card .rc-meta .star { color: #f59e0b; }
.row-card .rc-meta .dot { color: rgba(15, 23, 42, 0.2); }
.row-card .rc-categories {
    font-size: 0.7rem;
    color: var(--ss-muted);
    margin: 0;
}
.row-card .rc-right {
    text-align: right;
    flex-shrink: 0;
}
.row-card .rc-next-slot {
    font-size: 0.7rem;
    color: #0f766e;
    font-weight: 500;
    margin: 0;
}
.row-card .rc-price {
    font-size: 0.7rem;
    color: var(--ss-muted);
    margin: 0.2rem 0 0;
}
.row-card .rc-description {
    font-size: 0.72rem;
    color: var(--ss-muted);
    margin: 0.25rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Verified badge inline icon */
.verified-icon { color: #0f766e; flex-shrink: 0; }

/* "next slot" pill on search results */
.next-slot-pill {
    display: inline-block;
    background: var(--ss-cream);
    color: var(--ss-ink);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* ============ Company card ============ */

.company-card {
    background: #fff;
    border-radius: var(--ss-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 0.75rem;
}
.company-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ss-shadow-soft);
    text-decoration: none;
    color: inherit;
}
.company-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ss-cream);
    position: relative;
}
.company-card__image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.company-card__badge {
    position: absolute;
    top: 0.75rem; left: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ss-ink);
}
.company-card__fav {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    width: 36px; height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: #ef4444;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.company-card__body { padding: 0.85rem 1rem 1rem; }
.company-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}
.company-card__meta {
    font-size: 0.8rem;
    color: var(--ss-muted);
    margin: 0 0 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.company-card__meta .rating { color: #f59e0b; font-weight: 600; }
.company-card__price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f766e;
}

/* ============ Service card (in company detail) ============ */

.service-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--ss-radius);
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.service-row:hover { border-color: rgba(20, 184, 166, 0.5); text-decoration: none; color: inherit; }
.service-row__title { font-weight: 700; margin: 0 0 0.15rem; font-size: 0.95rem; }
.service-row__meta { font-size: 0.78rem; color: var(--ss-muted); margin: 0; }
.service-row__price { font-weight: 700; color: #0f766e; white-space: nowrap; }

/* ============ Bottom tab nav ============ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.08);
}
.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 0.25rem 0.6rem;
    color: var(--ss-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.25rem;
    transition: color 0.15s ease;
    position: relative;
}
.bottom-nav__item i { font-size: 1.25rem; }
.bottom-nav__item.active { color: #0f766e; }
.bottom-nav__item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%; right: 30%;
    height: 3px;
    background: #0f766e;
    border-radius: 0 0 4px 4px;
}
.bottom-nav__item .badge-dot {
    position: absolute;
    top: 0.3rem;
    right: 28%;
    min-width: 14px; height: 14px;
    padding: 0 4px;
    background: #f59e0b;
    color: #1f2937;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #fff;
}

/* ============ Buttons ============ */

.btn-primary-ss {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: var(--ss-shadow-soft);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    text-decoration: none;
}
.btn-primary-ss:hover {
    transform: translateY(-1px);
    box-shadow: var(--ss-shadow-elevated);
    color: #fff;
    text-decoration: none;
}
.btn-primary-ss:active { transform: translateY(0); }
.btn-primary-ss:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary-ss {
    background: #fff;
    color: #0f766e;
    border: 1.5px solid #14b8a6;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    text-decoration: none;
}
.btn-secondary-ss:hover { background: rgba(20, 184, 166, 0.06); color: #0f766e; text-decoration: none; }

.btn-ghost-ss {
    background: transparent;
    border: none;
    color: var(--ss-muted);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-ghost-ss:hover { color: var(--ss-ink); text-decoration: none; }

/* ============ Sticky CTA at bottom ============ */

.sticky-cta {
    position: sticky;
    bottom: calc(var(--tab-bar-height) + 0.5rem);
    z-index: 30;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.95) 30%);
}

/* ============ Forms ============ */

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ss-ink);
}
.field-input,
.field-textarea,
.field-select {
    padding: 0.7rem 0.9rem;
    border: 1.5px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--ss-ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.field-help {
    font-size: 0.75rem;
    color: var(--ss-muted);
}
.field-error {
    font-size: 0.78rem;
    color: #ef4444;
}

/* ============ Badges / chips ============ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: var(--ss-cream);
    color: var(--ss-ink);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.chip.is-active { background: #0f766e; color: #fff; }
.chip.is-success { background: rgba(20, 184, 166, 0.15); color: #0f766e; }
.chip.is-warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.chip.is-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.chip.is-info { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.chip.is-muted { background: rgba(15, 23, 42, 0.06); color: var(--ss-muted); }

/* ============ Booking statuses ============ */

.status-pending     { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.status-confirmed   { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.status-inprogress  { background: rgba(20, 184, 166, 0.15); color: #0f766e; }
.status-completed,
.status-settled     { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.status-cancelled,
.status-refunded    { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }

/* ============ Empty state ============ */

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ss-muted);
}
.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}
.empty-state .title { font-weight: 700; color: var(--ss-ink); margin: 0 0 0.3rem; }

/* ============ Utility ============ */

.text-muted { color: var(--ss-muted) !important; }
.text-primary-ss { color: #0f766e !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.rounded { border-radius: var(--ss-radius); }
.divider { height: 1px; background: rgba(15, 23, 42, 0.06); margin: 1rem 0; }

/* Horizontal scroll row */
.h-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 1.25rem 0.75rem;
    margin: 0 -1.25rem;
    -webkit-overflow-scrolling: touch;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* Validation classes from Blazor */
.valid.modified:not([type=checkbox]) { outline: 1px solid #15803d; }
.invalid { outline: 1px solid #ef4444; }
.validation-message { color: #ef4444; font-size: 0.78rem; }

.blazor-error-boundary {
    background: #b91c1c;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
}
.blazor-error-boundary::after { content: "Wystąpił błąd. Odśwież stronę."; }

/* ===== Language switcher (Konto) ===== */
.lang-switcher { display: inline-flex; gap: 0.25rem; background: #f1f5f4; border-radius: 999px; padding: 0.2rem; }
.lang-switcher__btn {
  border: 0; background: transparent; color: #4b5e5b;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem; border-radius: 999px; cursor: pointer;
}
.lang-switcher__btn.active { background: #14b8a6; color: #fff; }
