:root {
    --color-bg: #F8F7F5;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-muted: #6B6B6B;
    --color-accent: #8B7355;
    --color-accent-hover: #756045;
    --color-success: #4A7C59;
    --color-border: #E8E4DF;
    --color-shadow: rgba(26, 26, 26, 0.06);
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body.client-body {
    font-family: var(--font-ui);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.client-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* Login page */
.client-login {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.client-login .client-container {
    width: 100%;
}

.client-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.client-logo {
    width: min(270px, 80vw);
    height: auto;
    object-fit: contain;
}

.client-logo-sm {
    width: min(180px, 55vw);
    height: auto;
    object-fit: contain;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px var(--color-shadow);
    border: 1px solid var(--color-border);
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.login-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-help {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Topbar */
.client-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

/* Dashboard */
.welcome-section {
    margin-bottom: 2rem;
}

.welcome-greeting {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.welcome-section h1 {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.welcome-message {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Status grid */
.status-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 12px var(--color-shadow);
}

.status-card-main {
    grid-column: 1 / -1;
}

.status-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.status-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.status-value-sm {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

.progress-block {
    margin-top: 0.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.progress-header strong {
    color: var(--color-success);
    font-size: 1.1rem;
}

.progress-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), #5a9468);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Update card */
.update-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-accent);
}

.update-card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.update-card time {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.update-card p {
    color: var(--color-text);
    line-height: 1.5;
}

/* Timeline */
.timeline-section {
    margin-bottom: 2rem;
}

.timeline-section h2,
.gallery-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 0;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item.completed:not(:last-child)::before {
    background: var(--color-success);
    opacity: 0.4;
}

.timeline-marker {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    position: relative;
    z-index: 1;
}

.timeline-item.completed .timeline-marker {
    border-color: var(--color-success);
    background: var(--color-success);
}

.timeline-item.completed .timeline-marker::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.timeline-content {
    flex: 1;
    padding-top: 2px;
}

.timeline-title {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}

.timeline-item.pending .timeline-title {
    color: var(--color-text-muted);
}

.timeline-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

/* Gallery */
.gallery-section {
    margin-bottom: 2rem;
}

.gallery-empty p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.gallery-item {
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px var(--color-shadow);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox-content figcaption {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Forms & buttons */
.client-form .form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 1rem;
    background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

.btn-block {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-ghost:hover {
    color: var(--color-text);
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-info {
    background: #F0EDE8;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.client-footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (min-width: 640px) {
    .status-grid {
        grid-template-columns: 1fr 1fr;
    }

    .status-card-main {
        grid-column: 1 / -1;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .login-card {
        padding: 3rem 2.5rem;
    }

    .login-card h1 {
        font-size: 2rem;
    }
}

@media (min-width: 768px) {
    .client-container {
        padding: 2rem 1.5rem 4rem;
    }

    .welcome-section h1 {
        font-size: 2.25rem;
    }
}
