/* ==========================================================================
   Property Broker Portal – Frontend Styles
   ========================================================================== */

/* --- Variables --- */
:root {
    --pbp-primary: #1e3a5f;
    --pbp-primary-hover: #16304f;
    --pbp-success: #27ae60;
    --pbp-warning: #f39c12;
    --pbp-danger: #e74c3c;
    --pbp-text: #333;
    --pbp-text-light: #666;
    --pbp-border: #dce1e6;
    --pbp-bg: #f5f7fa;
    --pbp-white: #fff;
    --pbp-radius: 8px;
}

/* --- Auth Container --- */
.pbp-auth-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}
.pbp-auth-card {
    background: var(--pbp-white);
    border: 1px solid var(--pbp-border);
    border-radius: var(--pbp-radius);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pbp-auth-card-wide {
    max-width: 640px;
}
.pbp-auth-card h2 {
    margin-top: 0;
    color: var(--pbp-primary);
}
.pbp-auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--pbp-text-light);
}

/* --- Forms --- */
.pbp-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--pbp-text);
    font-size: 14px;
}
.pbp-form input[type="text"],
.pbp-form input[type="email"],
.pbp-form input[type="tel"],
.pbp-form input[type="password"],
.pbp-form input[type="date"],
.pbp-form select,
.pbp-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--pbp-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.pbp-form input:focus,
.pbp-form select:focus,
.pbp-form textarea:focus {
    border-color: var(--pbp-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}
.pbp-form-group {
    margin-bottom: 20px;
    flex: 1;
}
.pbp-form-row {
    display: flex;
    gap: 16px;
}
@media (max-width: 600px) {
    .pbp-form-row { flex-direction: column; gap: 0; }
}
.pbp-form-section-title {
    color: var(--pbp-primary);
    border-bottom: 2px solid var(--pbp-bg);
    padding-bottom: 8px;
    margin-top: 28px;
    margin-bottom: 16px;
    font-size: 16px;
}
.pbp-field-note {
    display: block;
    font-size: 12px;
    color: var(--pbp-text-light);
    margin-top: 4px;
}
.required { color: var(--pbp-danger); }

/* --- File Upload --- */
.pbp-file-upload {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px dashed var(--pbp-border);
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.pbp-file-upload:hover {
    border-color: var(--pbp-primary);
}
.pbp-file-upload input[type="file"] {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.pbp-file-label {
    color: var(--pbp-text-light);
    font-size: 14px;
}

/* --- Checkbox --- */
.pbp-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    font-size: 14px;
}
.pbp-checkbox-label input[type="checkbox"] {
    width: auto;
}

/* --- Buttons --- */
.pbp-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}
.pbp-btn:active { transform: scale(0.98); }
.pbp-btn-primary {
    background: var(--pbp-primary);
    color: var(--pbp-white);
}
.pbp-btn-primary:hover { background: var(--pbp-primary-hover); color: var(--pbp-white); }
.pbp-btn-primary:disabled {
    background: #8899aa;
    cursor: not-allowed;
}
.pbp-btn-outline {
    background: transparent;
    color: var(--pbp-primary);
    border: 1px solid var(--pbp-primary);
}
.pbp-btn-outline:hover { background: var(--pbp-bg); color: var(--pbp-primary); }
.pbp-btn-sm { padding: 6px 14px; font-size: 13px; }
.pbp-btn-full { width: 100%; text-align: center; }

/* --- Notices --- */
.pbp-notice {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.pbp-notice-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.pbp-notice-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.pbp-notice-warning  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* --- Company Suggestions --- */
.pbp-suggestions {
    background: var(--pbp-white);
    border: 1px solid var(--pbp-border);
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pbp-suggestion-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--pbp-text-light);
    margin: 0 0 8px;
}
.pbp-suggestion-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: var(--pbp-bg);
    border: 1px solid var(--pbp-border);
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.pbp-suggestion-btn:last-child { margin-bottom: 0; }
.pbp-suggestion-btn:hover { background: #e8edf2; }
.pbp-match-type { font-size: 11px; color: var(--pbp-text-light); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.pbp-dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}
.pbp-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.pbp-welcome h2 { margin: 0; color: var(--pbp-primary); }
.pbp-company-badge {
    display: inline-block;
    background: var(--pbp-bg);
    color: var(--pbp-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

/* --- Tabs --- */
.pbp-tabs {
    display: flex;
    border-bottom: 2px solid var(--pbp-border);
    margin-bottom: 24px;
    gap: 0;
}
.pbp-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--pbp-text-light);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pbp-tab:hover { color: var(--pbp-primary); }
.pbp-tab.active {
    color: var(--pbp-primary);
    border-bottom-color: var(--pbp-primary);
}

/* --- Panels --- */
.pbp-panel {
    background: var(--pbp-white);
    border: 1px solid var(--pbp-border);
    border-radius: var(--pbp-radius);
    padding: 28px;
}
.pbp-panel h3 {
    margin-top: 0;
    color: var(--pbp-primary);
}

/* --- Empty State --- */
.pbp-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--pbp-text-light);
}
.pbp-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--pbp-border);
    margin-bottom: 12px;
}

/* --- Document List --- */
.pbp-doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pbp-doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--pbp-bg);
    border-radius: 6px;
    transition: background 0.15s;
}
.pbp-doc-item:hover { background: #e8edf2; }
.pbp-doc-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--pbp-primary);
}
.pbp-doc-info { flex: 1; }
.pbp-doc-info strong { display: block; margin-bottom: 4px; }
.pbp-doc-info p { margin: 0; font-size: 13px; color: var(--pbp-text-light); }
.pbp-doc-date { font-size: 12px; color: #999; }

/* --- Opportunity Grid --- */
.pbp-opp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.pbp-opp-card {
    border: 1px solid var(--pbp-border);
    border-radius: 6px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.pbp-opp-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pbp-opp-card h4 { margin: 8px 0 12px; color: var(--pbp-primary); }
.pbp-opp-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pbp-status-open { background: #d4edda; color: #155724; }
.pbp-status-in_progress { background: #fff3cd; color: #856404; }
.pbp-status-closed { background: #f0f0f1; color: #666; }
.pbp-opp-details p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--pbp-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pbp-opp-details .dashicons { font-size: 16px; width: 16px; height: 16px; }
.pbp-opp-desc {
    margin-top: 12px;
    font-size: 14px;
    color: var(--pbp-text);
    line-height: 1.5;
}

/* --- Pagination --- */
.pbp-pagination {
    margin-top: 20px;
    text-align: center;
}
.pbp-pagination a,
.pbp-pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 4px;
    text-decoration: none;
}
.pbp-pagination .current {
    background: var(--pbp-primary);
    color: var(--pbp-white);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .pbp-auth-card { padding: 24px; }
    .pbp-tabs { overflow-x: auto; }
    .pbp-tab { padding: 10px 14px; font-size: 13px; }
    .pbp-dashboard-header { flex-direction: column; align-items: flex-start; }
    .pbp-opp-grid { grid-template-columns: 1fr; }
}

/* --- Auth Logo --- */
.pbp-auth-logo {
    text-align: center;
    margin-bottom: 20px;
}
.pbp-auth-logo img {
    max-height: 80px;
    max-width: 240px;
    height: auto;
    /* Ensure visibility on light backgrounds */
    filter: brightness(1);
}
