/* ==========================================================================
   CPTG Client Portal Styles
   Matches site design: charcoal/black + brass (#B8952A), Cormorant Garamond + Inter
   ========================================================================== */

/* ---------- LOGIN ---------- */
.portal-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.portal-login-card {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
}

.portal-login-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    color: #B8952A;
    margin: 0 0 8px;
}

.portal-login-header p {
    color: #999;
    font-size: 14px;
    margin: 0 0 24px;
}

.portal-form .portal-field {
    margin-bottom: 20px;
}

.portal-form label {
    display: block;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-form input[type="email"],
.portal-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: #0A0A0A;
    border: 1px solid #444;
    border-radius: 3px;
    color: #E5E5E5;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.portal-form input:focus {
    outline: none;
    border-color: #B8952A;
}

.portal-login-footer {
    margin-top: 24px;
    text-align: center;
}

.portal-login-footer p {
    color: #666;
    font-size: 13px;
}

.portal-login-footer a {
    color: #B8952A;
    text-decoration: none;
}

/* ---------- BUTTONS ---------- */
.portal-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.portal-btn-primary {
    background: #B8952A;
    color: #0A0A0A;
    width: 100%;
}

.portal-btn-primary:hover {
    background: #D4AB3A;
}

.portal-btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
}

.portal-btn-outline {
    background: transparent;
    color: #B8952A;
    border: 1px solid #B8952A;
}

.portal-btn-outline:hover {
    background: rgba(184, 149, 42, 0.1);
}

/* ---------- ALERTS ---------- */
.portal-alert {
    padding: 12px 16px;
    border-radius: 3px;
    font-size: 14px;
    margin-bottom: 20px;
}

.portal-alert-warning {
    background: rgba(184, 149, 42, 0.1);
    border: 1px solid #B8952A;
    color: #D4AB3A;
}

.portal-alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
}

.portal-alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #dc3545;
}

/* ---------- DASHBOARD ---------- */
.portal-dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #333;
}

.portal-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 32px;
    color: #E5E5E5;
    margin: 0;
}

.portal-subtitle {
    color: #888;
    font-size: 14px;
    margin: 4px 0 0;
}

/* ---------- PROPERTY CARDS ---------- */
.portal-properties-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-property-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.portal-property-card:hover {
    border-color: #B8952A;
    background: #222;
}

.portal-property-icon {
    color: #B8952A;
    flex-shrink: 0;
}

.portal-property-info {
    flex: 1;
    min-width: 0;
}

.portal-property-address {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 20px;
    color: #E5E5E5;
    margin: 0 0 4px;
}

.portal-property-pin,
.portal-property-number {
    color: #888;
    font-size: 13px;
    margin: 2px 0;
}

.portal-property-arrow {
    color: #666;
    flex-shrink: 0;
}

.portal-property-card:hover .portal-property-arrow {
    color: #B8952A;
}

/* ---------- STATUS BADGES ---------- */
.portal-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.portal-status-badge-lg {
    padding: 6px 16px;
    font-size: 13px;
}

.status-active {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-pending {
    background: rgba(184, 149, 42, 0.15);
    color: #D4AB3A;
    border: 1px solid rgba(184, 149, 42, 0.3);
}

.status-resolved {
    background: rgba(108, 117, 125, 0.15);
    color: #adb5bd;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-escalated {
    background: rgba(220, 53, 69, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* ---------- PROPERTY DETAIL ---------- */
.portal-property-detail {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

.portal-back-link {
    margin-bottom: 24px;
}

.portal-back-link a {
    color: #B8952A;
    text-decoration: none;
    font-size: 14px;
}

.portal-back-link a:hover {
    text-decoration: underline;
}

.portal-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #333;
}

.portal-detail-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    color: #E5E5E5;
    margin: 0;
}

.portal-detail-pin,
.portal-detail-matter {
    color: #888;
    font-size: 14px;
    margin: 4px 0;
}

/* ---------- SECTIONS ---------- */
.portal-section {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
}

.portal-section h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 20px;
    color: #B8952A;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

/* ---------- AI SUMMARY ---------- */
.portal-ai-summary {
    border-color: #B8952A;
    background: linear-gradient(135deg, #1A1A1A 0%, #1f1a10 100%);
}

.portal-ai-text {
    color: #E5E5E5;
    font-size: 15px;
    line-height: 1.7;
}

/* ---------- DETAILS GRID ---------- */
.portal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.portal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.portal-detail-value {
    font-size: 15px;
    color: #E5E5E5;
}

/* ---------- TIMELINE ---------- */
.portal-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portal-timeline-item {
    display: flex;
    gap: 16px;
    padding-left: 16px;
    border-left: 2px solid #333;
}

.portal-timeline-date {
    flex-shrink: 0;
    width: 100px;
    font-size: 13px;
    color: #B8952A;
    font-weight: 600;
}

.portal-timeline-content {
    flex: 1;
}

.portal-timeline-content strong {
    color: #E5E5E5;
    font-size: 14px;
}

.portal-timeline-content p {
    color: #999;
    font-size: 13px;
    margin: 4px 0 0;
    line-height: 1.5;
}

/* ---------- TASKS ---------- */
.portal-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-task-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.portal-task-status.pending {
    background: #B8952A;
}

.portal-task-status.complete {
    background: #28a745;
}

.portal-task-info strong {
    color: #E5E5E5;
    font-size: 14px;
}

.portal-task-due {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ---------- EMPTY STATE ---------- */
.portal-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.portal-empty-state h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    color: #E5E5E5;
    margin-bottom: 12px;
}

.portal-empty-state a {
    color: #B8952A;
}

/* ---------- LOADING ---------- */
.portal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.portal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: #B8952A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.portal-muted {
    color: #888;
    font-style: italic;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .portal-header {
        flex-direction: column;
        gap: 16px;
    }

    .portal-detail-header {
        flex-direction: column;
        gap: 12px;
    }

    .portal-property-card {
        flex-wrap: wrap;
    }

    .portal-property-status {
        margin-left: 52px;
    }

    .portal-timeline-item {
        flex-direction: column;
        gap: 4px;
    }

    .portal-timeline-date {
        width: auto;
    }

    .portal-details-grid {
        grid-template-columns: 1fr;
    }
}
