@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Public Premium Scoping */
.reloop-crm-public-wrap {
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    margin: 40px auto 40px auto;
    max-width: 1200px;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
}

.reloop-crm-public-wrap * {
    box-sizing: border-box;
}

/* Base resets within wrap */
.reloop-crm-public-wrap h1, 
.reloop-crm-public-wrap h2, 
.reloop-crm-public-wrap h3, 
.reloop-crm-public-wrap h4 {
    margin-top: 0;
    color: var(--text-main);
    font-weight: 600;
}

.reloop-crm-public-wrap p {
    margin-top: 0;
    line-height: 1.5;
}

/* Navbar */
.crm-public-navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.crm-public-nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.crm-public-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Buttons */
.crm-public-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.crm-public-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.crm-public-btn-primary:hover {
    background-color: var(--primary-hover);
}

.crm-public-btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.crm-public-btn-secondary:hover {
    background-color: var(--bg-color);
}

/* Grid Layout */
.crm-public-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .crm-public-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.crm-public-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

/* Form Elements */
.crm-public-input, .crm-public-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
    background: #f9fafb;
}

.crm-public-input:focus, .crm-public-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Status & Timeline */
.crm-public-status-box {
    display: flex;
    justify-content: space-between;
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.crm-public-timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 16px;
    padding-left: 32px;
}

.crm-public-timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.crm-public-timeline-item::before {
    content: '';
    position: absolute;
    left: -41px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 4px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
}

.crm-public-timeline-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.crm-public-timeline-content {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 12px;
}

/* Chat/Messages */
.crm-public-chat-box {
    height: 400px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-public-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.crm-public-msg-me {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.crm-public-msg-them {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Document List */
.crm-public-doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crm-public-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 12px;
}
