/* ============================================================
   Guest Access Pages — Precision System
   Extends auth.css for code entry page.
   Provides app-shell layout for dashboard/trial/settings pages.
   ============================================================ */

/* ---- Code entry input (enter-code page only) ---- */
.guest-code-input {
    text-align: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.guest-code-input::placeholder {
    letter-spacing: 0.12em;
    font-weight: 400;
}

/* ---- Description text ---- */
.guest-code-description {
    font-size: var(--font-size-sm);
    color: var(--color-grey-500);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* ---- Or divider (login page) ---- */
.guest-or-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    color: var(--color-grey-300);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.guest-or-divider::before,
.guest-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-grey-200);
}

/* ============================================================
   Guest App Shell — three-part layout like the main app
   ============================================================ */

.guest-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-grey-900);
}

/* ---- Header ---- */
.guest-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-navbar);
    color: #ffffff;
    min-height: 48px;
}

.guest-header .brand-mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.guest-header-title {
    font-family: 'General Sans', var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    margin: 0;
    color: #ffffff;
}

.guest-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius);
    transition: color var(--transition-fast), background var(--transition-fast);
    flex-shrink: 0;
    margin-left: -4px;
}

.guest-header-back:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.guest-header-back svg {
    width: 20px;
    height: 20px;
}

/* ---- Scrollable content ---- */
.guest-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.guest-content {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-4);
}

/* ---- Section titles ---- */
.guest-section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-grey-900);
    margin: 0 0 var(--space-4);
}

.guest-section-subtitle {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-grey-900);
    margin: var(--space-6) 0 var(--space-2);
}

.guest-section-desc {
    font-size: var(--font-size-sm);
    color: var(--color-grey-500);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
}

/* ---- List items (trials / measurements) ---- */
.guest-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-grey-100);
    border: 1px solid var(--color-grey-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.guest-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-4);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-grey-900);
    transition: background-color var(--transition-fast);
    min-height: 64px;
}

.guest-list-item:hover {
    background-color: var(--color-grey-50);
}

.guest-list-item:active {
    background-color: var(--color-grey-100);
}

.guest-list-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guest-list-item-name {
    font-size: var(--font-size-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.guest-list-item-meta {
    font-size: var(--font-size-sm);
    color: var(--color-grey-500);
}

.guest-list-item-sep {
    margin: 0 2px;
}

.guest-list-item-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-grey-300);
}

.guest-list-item-run {
    flex-shrink: 0;
}

/* ---- Empty state ---- */
.guest-empty {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-grey-500);
}

.guest-empty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-3);
    color: var(--color-grey-300);
}

.guest-empty p {
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.5;
}

/* ---- Actions footer ---- */
.guest-actions {
    margin-top: var(--space-6);
}

/* ---- Bottom nav ---- */
.guest-bottom-nav {
    flex-shrink: 0;
    min-height: 56px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-grey-100);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.guest-bottom-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-height: 56px;
}

.guest-bottom-nav-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: var(--tap-target-min);
    min-height: var(--tap-target-min);
    color: var(--color-grey-500);
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.guest-bottom-nav-link svg {
    width: 22px;
    height: 22px;
}

.guest-bottom-nav-link.is-active {
    color: var(--color-primary);
}

@media (display-mode: standalone) {
    .guest-bottom-nav {
        min-height: 64px;
    }

    .guest-bottom-nav-inner {
        min-height: 64px;
    }

    .guest-bottom-nav-link {
        gap: 3px;
        font-size: 0.75rem;
    }

    .guest-bottom-nav-link svg {
        width: 24px;
        height: 24px;
    }
}
