* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f8fafc;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

header p {
    color: #6b7280;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e5e7eb;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 3px solid #f8fafc;
}

.step.active .step-number {
    background-color: #3b82f6;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.step.active .step-label {
    color: #3b82f6;
}

/* Form Steps */
.form-step {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-step.active {
    display: block;
}

/* Minimal form spacing when using Bootstrap grid */
.form-grid { display: block; }
.form-grid .form-group { margin-bottom: 0.75rem; }
.checkbox-group { margin-bottom: 0.75rem; }

/* Responsive: handled by Bootstrap */

/* small info icon for tooltips */
.info-icon {
    display: inline-block;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    margin-left: 6px;
    cursor: help;
}

/* Ensure checkbox left of label and compact */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.form-check-input {
    /* Fixed small size checkboxes */
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    margin-top: 0 !important;
    /* Ensure consistent rendering across browsers */
    -webkit-appearance: checkbox;
    appearance: checkbox;
    flex: 0 0 14px;
    /* On some browsers width/height on checkboxes are not effective; use scale fallback */
    transform-origin: center center;
}
.form-check-label {
    margin-bottom: 0;
    line-height: 1.3;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

/* Let Bootstrap's form-control handle input styling
   Fallback for any non-bootstrap inputs
*/
input:not(.form-control), select:not(.form-control) {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Custom action buttons */

.btn-print {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(99,102,241,0.16);
}
.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(99,102,241,0.22);
}

.btn .me-1 { /* ensure icon spacing */
    opacity: 0.95;
}

/* Navbar user avatar small */
.user-avatar-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* RPM Result */
.rpm-result {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Markdown Content Styling (Seperti DeepSeek) */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #374151;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    color: #111827;
}

.markdown-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5em;
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.3em;
}

.markdown-content h4 {
    font-size: 1.1em;
    color: #4b5563;
}

.markdown-content p {
    margin: 1em 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.markdown-content li {
    margin: 0.5em 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.markdown-content th {
    background: #f8fafc;
    font-weight: 600;
    padding: 0.8em;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.markdown-content td {
    padding: 0.8em;
    border-bottom: 1px solid #e2e8f0;
}

.markdown-content tr:last-child td {
    border-bottom: none;
}

.markdown-content code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.markdown-content pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.markdown-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1em;
    margin: 1.5em 0;
    color: #6b7280;
    font-style: italic;
}

.markdown-content strong {
    font-weight: 600;
    color: #111827;
}

.markdown-content em {
    font-style: italic;
}

/* RPM Header & Footer */
.rpm-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.rpm-header h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.rpm-header h4 {
    color: #3b82f6;
}

.rpm-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.9rem;
}
.signature-box {
    height: 90px;
    width: 230px;
    border-bottom: 2px solid #222;
    margin-top: 30px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-steps::before {
        display: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Support chat widget styles */
.support-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 3000;
}
.support-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 24px rgba(59,130,246,0.2);
    cursor: pointer;
    transition: all 0.2s;
}
.support-chat-toggle:hover {
    transform: scale(1.08);
}
.support-chat-panel {
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    max-height: 500px;
}
.support-chat-header {
    padding: 12px 14px;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}
.support-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #fbfdff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.support-chat-bubble {
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-break: break-word;
}
.support-chat-bubble .who {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.support-chat-bubble .text {
    background: #e5e7eb;
    padding: 10px 12px;
    border-radius: 8px;
    line-height: 1.5;
    font-size: 13px;
    color: #374151;
}
.support-chat-bubble.agent .text {
    background: #dbeafe;
    color: #1e40af;
}
.support-chat-bubble.user {
    align-items: flex-end;
}
.support-chat-bubble.user .text {
    background: #3b82f6;
    color: white;
}

/* Better styling for markdown content in chat */
.support-chat-bubble .text strong {
    font-weight: 700;
    color: inherit;
}
.support-chat-bubble.agent .text strong {
    color: #1e40af;
    font-weight: 700;
}
.support-chat-bubble.user .text strong {
    color: white;
    font-weight: 700;
}

.support-chat-bubble .text ol,
.support-chat-bubble .text ul {
    margin: 6px 0 !important;
    padding-left: 18px !important;
}

.support-chat-bubble .text li {
    margin: 3px 0 !important;
    line-height: 1.4;
}

.support-chat-bubble .text p {
    margin: 4px 0 !important;
}

.support-chat-input {
    padding: 10px;
    border-top: 1px solid #f1f5f9;
    gap: 8px;
}
.support-chat-input .form-control {
    height: 36px;
    font-size: 13px;
    border-radius: 6px;
}
.support-chat-input .btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== Curhat Guru Chat Styling (Minimalist & Elegant) ===== */
.curhat-guru-container {
    display: flex;
    flex-direction: column;
    height: 480px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.curhat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(to bottom, #ffffff, #fafbfc);
}

.curhat-messages-area::-webkit-scrollbar {
    width: 6px;
}

.curhat-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.curhat-messages-area::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.curhat-messages-area::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.curhat-bubble {
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.curhat-bubble.user {
    align-self: flex-end;
    max-width: 80%;
}

.curhat-bubble.agent {
    align-self: flex-start;
    max-width: 85%;
}

.curhat-bubble.error {
    align-self: flex-start;
    max-width: 85%;
}

.curhat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.curhat-bubble-header strong {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.curhat-bubble-header small {
    font-size: 0.75rem;
    opacity: 0.6;
}

.curhat-bubble-content {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.curhat-bubble.user .curhat-bubble-content {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #ffffff;
    border-radius: 12px 4px 12px 12px;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.15);
}

.curhat-bubble.agent .curhat-bubble-content {
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 4px 12px 12px 12px;
}

.curhat-bubble.error .curhat-bubble-content {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px 12px 12px 12px;
    border-left: 3px solid #dc2626;
}

.curhat-bubble-content p {
    margin: 0;
}

.curhat-bubble-content p + p {
    margin-top: 6px;
}

.curhat-bubble-content strong {
    font-weight: 600;
}

.curhat-bubble-content em {
    font-style: italic;
}

.curhat-bubble-content ul,
.curhat-bubble-content ol {
    margin: 6px 0 0 18px;
    padding: 0;
}

.curhat-bubble-content li {
    margin-bottom: 3px;
}

.curhat-bubble-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.curhat-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.curhat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
}

.curhat-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background: #ffffff;
}

.curhat-input::placeholder {
    color: #9ca3af;
}

.curhat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.15);
}

.curhat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.25);
}

.curhat-send-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.15);
}

.curhat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.curhat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 400px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    margin-top: 1.5rem;
    text-align: center;
}

.curhat-empty-state .empty-icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.curhat-empty-state h4 {
    margin: 0 0 8px 0;
    color: #334155;
    font-weight: 600;
    font-size: 1.1rem;
}

.curhat-empty-state p {
    margin: 0 0 20px 0;
    color: #94a3b8;
    font-size: 0.95rem;
}

.curhat-empty-state .btn {
    margin-top: 8px;
}