/* FreshCircle retail-customer module — mobile-first shell + shared components. Auth forms reuse the
   existing .login-card/.field/.btn/.alert classes; this file covers what's unique to FreshCircle. */

.fc-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-size: 1rem;
}

.fc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.fc-topbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 650;
    font-size: var(--text-lg);
    color: var(--text-primary);
    text-decoration: none;
}

.fc-topbar-logo { height: 24px; width: 24px; }

.fc-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.fc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-5) var(--space-4) calc(96px + env(safe-area-inset-bottom));
}

.fc-page {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.fc-page h1 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.fc-page-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
}

.fc-footer {
    width: 100%;
    max-width: 440px;
    margin: var(--space-6) auto 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    font-size: var(--text-xs);
}

.fc-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.fc-footer a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.fc-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 20;
}

.fc-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2);
    min-height: 52px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-xs);
    font-weight: 600;
}

.fc-tab.active {
    color: var(--accent);
    background: var(--accent-soft-bg);
}

/* My Card — the QR the customer shows at the till. Large, high-contrast, and screen-brightness
   friendly (white card even in dark mode) since it needs to scan cleanly under till lighting. */
.fc-qr-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-md);
}

.fc-qr-card img {
    width: 100%;
    max-width: 280px;
    height: auto;
    image-rendering: pixelated;
}

.fc-qr-code {
    font-family: var(--font-mono, monospace);
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
    color: #111;
}

.fc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-4);
    color: var(--text-secondary);
}

/* Claim-card scan stage — same shape as the restock scan overlay, kept separate so the two modules
   can evolve independently even though they currently look alike. */
.fc-scan-stage {
    position: relative;
    flex: 1;
    min-height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

.fc-scan-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Matches the branded corner-bracket viewfinder used by the Restock scan stage (.restock-scan-corner,
   defined in restock.css and loaded app-wide) instead of a plain solid-border rectangle. */
.fc-scan-guide {
    position: absolute;
    inset: 15% 20%;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, .28);
    pointer-events: none;
}

.fc-scan-hint {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
}

.fc-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: var(--space-5) 0;
}

.fc-divider::before, .fc-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.fc-settings-section {
    margin-bottom: var(--space-6);
}

.fc-settings-section h2 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

/* Dashboard — star progress toward the next reward. */
.fc-progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.fc-progress-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.fc-progress-count {
    font-size: var(--text-xl);
    font-weight: 700;
}

.fc-progress-count small {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.fc-progress-track {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--bg-canvas);
    overflow: hidden;
}

.fc-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
    transition: width 0.3s ease;
}

.fc-progress-hint {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.fc-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.fc-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
}

.fc-stat-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: 700;
}

.fc-stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.fc-offer-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--accent-soft-bg);
    color: var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.fc-offer-banner {
    margin-bottom: var(--space-5);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fc-offer-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.fc-quick-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.fc-quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
}

.fc-quick-link-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Purchase history / star ledger — plain clickable/static rows. */
.fc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fc-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
}

.fc-list-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fc-list-item-title {
    font-weight: 600;
}

.fc-list-item-subtitle {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.fc-list-item-amount {
    font-weight: 650;
    white-space: nowrap;
}

.fc-list-item-amount.negative {
    color: var(--danger, #dc2626);
}

.fc-list-item-amount.positive {
    color: var(--success, #16a34a);
}

.fc-receipt-text {
    white-space: pre-wrap;
    font-family: var(--font-mono, monospace);
    font-size: var(--text-xs);
    background: var(--bg-canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-top: var(--space-5);
}
