/* 07 Heaven Client Portal */

:root {
    --brand:       #36A7DF;
    --brand-light: color-mix(in srgb, var(--brand) 12%, transparent);
    --bg:          #f5f6f8;
    --surface:     #ffffff;
    --border:      #e4e6ea;
    --text:        #1a1d23;
    --text-muted:  #6b7280;
    --success:     #16a34a;
    --warning:     #d97706;
    --danger:      #dc2626;
    --radius:      10px;
    --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.10);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ── Auth pages ─────────────────────────────────────────────────────────────── */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.auth-logo-img {
    height: 36px;
    width: auto;
}


.auth-heading {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.auth-link {
    text-align: center;
    font-size: 13px;
    margin-top: 16px;
    color: var(--text-muted);
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s;
}

.field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
}

.btn-primary:hover { background: color-mix(in srgb, var(--brand) 82%, #000); }

.alert {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error   { background: #fef2f2; color: var(--danger);  border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }


/* ── Header ─────────────────────────────────────────────────────────────────── */

.portal-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-logo {
    height: 32px;
    max-width: 140px;
    object-fit: contain;
}

.client-name-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-label {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    font-size: 13px;
    color: var(--text-muted);
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
    color: var(--text);
    border-color: #c0c4cc;
    text-decoration: none;
}


/* ── Main layout ─────────────────────────────────────────────────────────────── */

.portal-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.back-link:hover { color: var(--brand); text-decoration: none; }


/* ── Project grid ────────────────────────────────────────────────────────────── */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s, border-color 0.15s;
    color: var(--text);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
    text-decoration: none;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.project-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}


/* ── Status badges ────────────────────────────────────────────────────────────── */

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-active     { background: #eff6ff; color: #1d4ed8; }
.status-in_progress { background: #fef9c3; color: #854d0e; }
.status-complete   { background: #f0fdf4; color: var(--success); }
.status-paused     { background: #f5f5f5; color: #6b7280; }
.status-planning   { background: #f5f3ff; color: #7c3aed; }


/* ── Progress bar ─────────────────────────────────────────────────────────────── */

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 99px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.progress-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}


/* ── Meta items ────────────────────────────────────────────────────────────────── */

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.meta-overdue { color: var(--danger); font-weight: 600; }
.meta-soon    { color: var(--warning); font-weight: 600; }
.meta-type    { background: var(--bg); padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border); }


/* ── Project detail ─────────────────────────────────────────────────────────── */

.project-detail-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.project-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.project-detail-name {
    font-size: 20px;
    font-weight: 700;
}

.detail-meta-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-progress .progress-bar-wrap { max-width: 320px; }

.detail-meta-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.project-notes {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-left: 3px solid var(--brand);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: var(--text-muted);
}


/* ── Sections ───────────────────────────────────────────────────────────────── */

.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}


/* ── Task list ──────────────────────────────────────────────────────────────── */

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    transition: background 0.1s;
}

.task-item:hover { background: var(--bg); }

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brand);
    background: none;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, background 0.15s;
}

.task-check:hover {
    border-color: var(--brand);
}

.task-done .task-check {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.task-title {
    flex: 1;
    font-size: 14px;
}

.task-done .task-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task-priority-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    background: #fef2f2;
    color: var(--danger);
    flex-shrink: 0;
}

.task-due {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}


/* ── Empty state ─────────────────────────────────────────────────────────────── */

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px 0;
}


/* ── Header inner container ─────────────────────────────────────────────────── */

.portal-header-inner {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-left: 2px;
}

.header-07h-logo {
    height: 28px;
    width: auto;
}


/* ── Client page header ──────────────────────────────────────────────────────── */

.client-page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.client-page-header .page-title {
    margin-bottom: 0;
}

.client-logo-page {
    height: 40px;
    max-width: 120px;
    object-fit: contain;
}

.client-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* ── Documents ───────────────────────────────────────────────────────────────── */

.doc-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.doc-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}

.doc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.doc-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.doc-item:hover {
    border-color: var(--brand);
    background: var(--brand-light);
    text-decoration: none;
    color: var(--brand);
}


/* ── Help bar ────────────────────────────────────────────────────────────────── */

.help-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.help-bar-left {
    font-size: 13px;
    color: var(--text-muted);
}

.help-owner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand);
    padding: 6px 12px;
    border: 1px solid var(--brand);
    border-radius: 6px;
    transition: background 0.15s;
}

.help-link:hover {
    background: var(--brand-light);
    text-decoration: none;
}


/* ── Message form ────────────────────────────────────────────────────────────── */

.message-section { margin-bottom: 8px; }

.message-form { display: flex; flex-direction: column; gap: 12px; }

.message-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    resize: vertical;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.message-textarea:focus {
    outline: none;
    border-color: var(--brand);
}
.message-textarea::placeholder { color: var(--text-muted); }

.message-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.message-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.btn-send:hover { opacity: 0.88; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }


/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .portal-header { padding: 0 16px; }
    .portal-main   { padding: 24px 16px 48px; }
    .auth-box      { padding: 28px 24px; }
    .header-label  { display: none; }
    .project-grid  { grid-template-columns: 1fr; }
    .detail-meta-fields { gap: 14px; }
}
