/* === CLIENT PORTAL === */

/* ── LOGIN PAGE ── */
.cp-login-page {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px clamp(20px, 4vw, 60px);
}

.cp-login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.cp-login-brand {
    margin-bottom: 12px;
    color: var(--dim);
}

.cp-login-logo {
    height: 12px;
    width: auto;
    fill: currentColor;
}

.cp-login-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--dim);
    margin-bottom: 56px;
}

.cp-login-form {
    text-align: left;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cp-login-form .tl-form-group {
    position: relative;
    margin-bottom: 36px;
    width: 100%;
}

.cp-login-form .tl-form-group label {
    position: absolute;
    left: 0;
    top: 12px;
    font-size: 13px;
    color: var(--dim);
    letter-spacing: 0.02em;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left;
}

.cp-login-form .tl-form-group.focused label,
.cp-login-form .tl-form-group.has-value label {
    top: -8px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ash);
}

.cp-login-form .tl-form-group input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    padding: 12px 0 10px;
    -webkit-appearance: none;
    appearance: none;
}

.cp-login-form .tl-form-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line);
}

.cp-login-form .tl-form-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-login-form .tl-form-group.focused .tl-form-line::after {
    width: 100%;
}

.cp-login-form .tl-form-group.has-value .tl-form-line::after {
    width: 100%;
    background: var(--ash);
}

.cp-login-active {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.cp-login-active p {
    font-size: 13px;
    color: var(--dim);
    margin-bottom: 16px;
}

.cp-login-active strong {
    color: var(--text);
}

.cp-login-hint {
    font-size: 11px;
    line-height: 1.7;
    color: var(--dim);
    letter-spacing: 0.01em;
}

.cp-login-hint code {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--ash);
    background: var(--muted);
    padding: 2px 6px;
    border-radius: 3px;
}

.cp-login-status {
    margin-top: 16px;
    font-size: 12px;
    min-height: 20px;
}

.cp-status-error {
    color: #e05050;
}

/* Shake animation */
@keyframes cpShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
}

.cp-shake {
    animation: cpShake 0.6s ease;
}


/* ── BUTTONS ── */
.cp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    border: 1px solid var(--text);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.cp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--text);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.cp-btn:hover::before {
    width: 100%;
}

.cp-btn:hover {
    color: var(--bg);
}

.cp-btn-text,
.cp-btn-arrow {
    position: relative;
    z-index: 1;
}

.cp-btn-arrow {
    transition: transform 0.3s ease;
}

.cp-btn:hover .cp-btn-arrow {
    transform: translateX(4px);
}

.cp-btn.sending {
    pointer-events: none;
    opacity: 0.6;
}


/* ── DASHBOARD ── */
.cp-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 60px) 60px;
}

/* Header */
.cp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 40px;
}

.cp-project-title {
    font-family: var(--display);
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 4px;
}

.cp-client-name {
    font-size: 12px;
    color: var(--dim);
    letter-spacing: 0.04em;
}

.cp-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding-top: 8px;
}

.cp-status-badge {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 5px 14px;
    border-radius: 100px;
    font-weight: 500;
    white-space: nowrap;
}

.cp-status-discovery   { background: var(--muted); color: var(--dim); }
.cp-status-design      { background: rgba(232, 146, 124, 0.15); color: var(--salmon); }
.cp-status-development { background: rgba(232, 146, 124, 0.15); color: var(--salmon); }
.cp-status-in-progress { background: rgba(232, 146, 124, 0.15); color: var(--salmon); }
.cp-status-review      { background: rgba(57, 255, 20, 0.1); color: var(--fluo); }
.cp-status-complete    { background: rgba(57, 255, 20, 0.12); color: var(--fluo); }

.cp-logout {
    color: var(--dim);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.cp-logout:hover {
    color: var(--text);
}


/* ── PROGRESS PHASES ── */
.cp-phases {
    margin-bottom: 48px;
}

.cp-phases-track {
    display: flex;
    align-items: center;
}

.cp-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cp-phase-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: all 0.3s ease;
    color: var(--fluo);
}

.cp-phase-active .cp-phase-dot {
    border-color: var(--salmon);
    background: var(--salmon);
    box-shadow: 0 0 0 4px rgba(232, 146, 124, 0.15);
}

.cp-phase-done .cp-phase-dot {
    border-color: var(--fluo);
    background: transparent;
}

.cp-phase-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim);
    white-space: nowrap;
}

.cp-phase-active .cp-phase-label {
    color: var(--salmon);
    font-weight: 500;
}

.cp-phase-done .cp-phase-label {
    color: var(--text);
}

.cp-phase-line {
    flex: 1;
    height: 1px;
    background: var(--line);
    margin: 0 6px;
    margin-bottom: 24px;
    min-width: 20px;
}

.cp-phase-line-done {
    background: var(--fluo);
    opacity: 0.4;
}


/* ── GRID ── */
.cp-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.cp-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dim);
    margin-bottom: 24px;
    font-weight: 400;
}


/* ── FILES ── */
.cp-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.cp-file-card {
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.cp-file-card:hover {
    border-color: var(--ash);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cp-file-thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--dim);
}

.cp-file-ext {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ash);
}

.cp-file-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-file-name {
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-file-meta {
    font-size: 10px;
    color: var(--dim);
}

.cp-file-download {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(17, 17, 17, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    opacity: 0;
    transition: opacity 0.2s ease;
}

body[data-theme="daylight"] .cp-file-download {
    background: rgba(224, 220, 211, 0.85);
}

.cp-file-card:hover .cp-file-download {
    opacity: 1;
}


/* ── DROPBOX ── */
.cp-dropbox-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 4px;
    transition: border-color 0.25s ease, background 0.25s ease;
    text-decoration: none;
}

.cp-dropbox-card:hover {
    border-color: var(--ash);
    background: var(--muted);
}

.cp-dropbox-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ash);
}

.cp-dropbox-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-dropbox-label {
    font-size: 13px;
    color: var(--text);
    font-weight: 400;
}

.cp-dropbox-url {
    font-size: 11px;
    color: var(--dim);
}

.cp-dropbox-arrow {
    font-size: 18px;
    color: var(--dim);
    transition: transform 0.25s ease, color 0.25s ease;
}

.cp-dropbox-card:hover .cp-dropbox-arrow {
    transform: translateX(4px);
    color: var(--text);
}


/* ── TIMELINE ── */
.cp-timeline {
    position: relative;
    padding-left: 20px;
}

.cp-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--line);
}

.cp-milestone {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
}

.cp-milestone-dot {
    position: absolute;
    left: -20px;
    top: 16px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line);
    border: 2px solid var(--bg);
    flex-shrink: 0;
    z-index: 1;
}

.cp-milestone-done .cp-milestone-dot {
    background: var(--fluo);
}

.cp-milestone-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cp-milestone-date {
    font-size: 10px;
    color: var(--dim);
    letter-spacing: 0.04em;
}

.cp-milestone-label {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.cp-milestone:not(.cp-milestone-done) .cp-milestone-label {
    color: var(--dim);
}

.cp-milestone-check {
    flex-shrink: 0;
    color: var(--fluo);
    margin-top: 14px;
}


/* ── UPDATES ── */
.cp-updates {
    display: flex;
    flex-direction: column;
}

.cp-update {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.cp-update:first-child {
    padding-top: 0;
}

.cp-update:last-child {
    border-bottom: none;
}

.cp-update-date {
    display: block;
    font-size: 10px;
    color: var(--dim);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.cp-update-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}

.cp-update-text p {
    margin: 0;
}


/* ── EMPTY STATE ── */
.cp-empty {
    padding: 48px 0;
    text-align: center;
    color: var(--dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cp-empty p {
    font-size: 13px;
}


/* ── PORTAL FOOTER ── */
.cp-footer {
    margin-top: 80px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    text-align: center;
}

.cp-footer-link {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim);
    transition: color 0.2s;
}

.cp-footer-link strong {
    font-weight: 500;
    color: var(--ash);
}

.cp-footer-link:hover {
    color: var(--text);
}


/* ── BREADCRUMB ── */
.cp-breadcrumb {
    display: inline-block;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.04em;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.cp-breadcrumb:hover {
    color: var(--text);
}


/* ── CLIENT INFO BAR ── */
.cp-info-bar {
    display: flex;
    gap: 40px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cp-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cp-info-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dim);
}

.cp-info-value {
    font-size: 13px;
    color: var(--text);
}


/* ── QUOTES LIST ── */
.cp-quotes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cp-quote-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.cp-quote-card:hover {
    border-color: var(--ash);
    transform: translateY(-1px);
}

.cp-quote-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-quote-card-ref {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--text);
}

.cp-quote-card-org {
    font-size: 11px;
    color: var(--dim);
}

.cp-quote-card-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cp-quote-card-date {
    font-size: 10px;
    color: var(--dim);
}

.cp-status-quote-received  { background: var(--muted); color: var(--dim); }
.cp-status-quote-in_review { background: rgba(232, 146, 124, 0.15); color: var(--salmon); }
.cp-status-quote-quoted    { background: rgba(57, 255, 20, 0.1); color: var(--fluo); }
.cp-status-quote-accepted  { background: rgba(57, 255, 20, 0.15); color: var(--fluo); }


/* ── YEAR GROUPS ── */
.cp-year-group {
    margin-bottom: 28px;
}

.cp-year-group:last-child {
    margin-bottom: 0;
}

.cp-year-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--ash);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}


/* ── SHARED FOLDERS ── */
.cp-folders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* ── PROJECT LIST (Client page) ── */
.cp-projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cp-project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.cp-project-card:hover {
    border-color: var(--ash);
    transform: translateY(-1px);
}

.cp-project-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-project-card-title {
    font-size: 14px;
    font-weight: 500;
}

.cp-project-card-date {
    font-size: 11px;
    color: var(--dim);
}


/* ── RESPONSIVE ── */
@media (max-width: 700px) {
    .cp-header {
        flex-direction: column;
        gap: 16px;
        padding: 32px 0 28px;
    }

    .cp-header-right {
        padding-top: 0;
    }

    .cp-phases-track {
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .cp-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .cp-dropbox-card {
        padding: 18px;
        gap: 14px;
    }

    .cp-grid {
        gap: 36px;
    }
}