/* Landatec client portal — extends styles.css variables */
.portal-shell {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
}
.portal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}
.portal-nav .brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.portal-nav .nav-right { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.portal-nav .nav-right .user-email { color: var(--muted); }
.portal-nav .nav-right button,
.portal-nav .nav-right a {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.portal-nav .nav-right button:hover,
.portal-nav .nav-right a:hover { border-color: var(--accent); color: var(--accent); }

.portal-main { flex: 1; padding: 32px 24px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* Auth card */
.auth-card {
    max-width: 420px;
    margin: 80px auto;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.auth-card p { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }
.auth-card label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.auth-card input[type="email"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
    margin-bottom: 16px;
}
.auth-card input[type="email"]:focus { outline: none; border-color: var(--accent); }
.auth-card button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    color: #000;
    font: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.15s;
}
.auth-card button[type="submit"]:hover { opacity: 0.9; }
.auth-card button[type="submit"]:disabled { opacity: 0.5; cursor: wait; }
.auth-status { margin-top: 16px; font-size: 0.9rem; padding: 12px; border-radius: var(--radius-sm); display: none; }
.auth-status.success { display: block; background: rgba(52, 211, 153, 0.1); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.auth-status.error { display: block; background: rgba(248, 113, 113, 0.1); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.auth-status a { color: inherit; text-decoration: underline; }
.auth-foot { margin-top: 16px; display: flex; justify-content: space-between; font-size: 0.85rem; }
.auth-foot a { color: var(--accent); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-foot-note { font-size: 0.78rem; color: var(--muted); margin-top: 16px; text-align: center; }
.auth-foot-note a { color: var(--accent); }
.auth-card input[type="text"], .auth-card input[type="tel"], .auth-card input[type="password"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
    margin-bottom: 16px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

/* Profile panel inside dashboard */
.profile-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
}
.profile-panel h2 { margin: 0 0 16px; font-size: 1.05rem; }
.profile-panel form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-panel label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.profile-panel input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}
.profile-panel input:focus { outline: none; border-color: var(--accent); }
.profile-panel input[disabled] { opacity: 0.6; cursor: not-allowed; }
.profile-panel .actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.profile-panel button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.profile-panel .save-msg { color: #34d399; font-size: 0.85rem; }
@media (max-width: 600px) { .profile-panel form { grid-template-columns: 1fr; } }

/* Dashboard layout: split (list | thread) */
.portal-split {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    min-height: 70vh;
}
@media (max-width: 800px) {
    .portal-split { grid-template-columns: 1fr; }
    .portal-thread.hidden-mobile { display: none; }
}
.requests-list {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
}
.requests-list-header {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.requests-list-body { overflow-y: auto; flex: 1; max-height: 70vh; }
.request-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
}
.request-item:hover { background: rgba(255, 255, 255, 0.04); }
.request-item.active { background: rgba(251, 191, 36, 0.08); border-left: 3px solid var(--accent); padding-left: 13px; }
.request-item .title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.request-item .meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.status-chip.new { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.status-chip.reviewing { background: rgba(251, 191, 36, 0.15); color: var(--accent); }
.status-chip.in_progress { background: rgba(168, 85, 247, 0.15); color: #c4b5fd; }
.status-chip.delivered { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.status-chip.closed { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

/* Thread */
.portal-thread {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}
.thread-header { padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.thread-header h2 { margin: 0 0 8px; font-size: 1.05rem; }
.thread-header .meta { font-size: 0.85rem; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thread-header select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.85rem;
}
.thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 55vh;
    min-height: 300px;
}
.msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.msg .body { white-space: pre-wrap; }
.msg .ts { font-size: 0.72rem; opacity: 0.6; margin-top: 4px; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #000; }
.msg.theirs { align-self: flex-start; background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.05); }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 0.8rem; font-style: italic; }

.thread-input {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    display: flex;
    gap: 8px;
}
.thread-input textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    padding: 10px;
    resize: none;
    min-height: 44px;
    max-height: 140px;
}
.thread-input textarea:focus { outline: none; border-color: var(--accent); }
.thread-input button {
    background: var(--accent);
    border: none;
    color: #000;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.thread-input button:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); margin: 0 0 8px; }
.empty-state a { color: var(--accent); }

/* Signup package banner + textarea + password help */
.package-banner {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.package-banner strong { color: var(--text); margin-right: 6px; }
.auth-card textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
    margin-bottom: 8px;
    resize: vertical;
    min-height: 90px;
}
.auth-card textarea:focus { outline: none; border-color: var(--accent); }
.pw-help {
    font-size: 0.78rem;
    color: var(--muted);
    margin: -8px 0 16px;
}
