/* Registrar Chat - visual test only */

.dashboard-top-line,
.registrar-chat-page-top-line {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 910px;
}

.dashboard-top-line #dashboard-headline,
.registrar-chat-page-top-line h2 {
    flex: 1 1 auto;
    margin: 0;
}

.registrar-chat-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 10px 14px;
    background: #1976D2;
    color: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.registrar-chat-link::after {
    content: "";
    position: absolute;
    right: 13px;
    bottom: -6px;
    width: 0;
    height: 0;
    border-top: 8px solid #1976D2;
    border-left: 8px solid transparent;
}

.registrar-chat-link:hover,
.registrar-chat-link:focus {
    color: #FFD800;
}

.registrar-chat-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.50);
    z-index: 1100;
}

.registrar-chat-popup {
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 28px;
    border-radius: 6px;
    background: #EEFFEE;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.30);
}

.registrar-chat-popup h3 {
    margin: 0 36px 14px 0;
    color: #1A2528;
    font-size: 1.2rem;
}

.registrar-chat-intro {
    margin: 0 0 16px;
    color: #1A2528;
    font-size: 1rem;
    line-height: 1.5;
}

.registrar-chat-popup label {
    display: block;
    margin-bottom: 6px;
    color: #1A2528;
    font-size: 14px;
}

.registrar-chat-popup textarea {
    display: block;
    width: 100%;
    min-height: 135px;
    padding: 10px;
    border: 1px solid #AABBAA;
    border-radius: 4px;
    background: #FFFFFF;
    color: #1A2528;
    font: inherit;
    resize: vertical;
}

.registrar-chat-close {
    position: absolute;
    top: 9px;
    right: 13px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #263238;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.registrar-chat-close:hover,
.registrar-chat-close:focus {
    color: #FFD800;
}

.registrar-chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.registrar-chat-actions .cta-button {
    border: 0;
    cursor: pointer;
}

.registrar-chat-status {
    min-height: 20px;
    margin-top: 12px;
    color: #555555;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .dashboard-top-line,
    .registrar-chat-page-top-line {
        align-items: stretch;
        flex-direction: column;
        max-width: 835px;
    }

    .registrar-chat-link {
        align-self: flex-end;
    }

    .registrar-chat-popup {
        padding: 24px 20px;
    }
}

/* Step 5: unanswered chat badge */

.registrar-chat-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    background: #D32F2F;
    color: #FFFFFF;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.registrar-chat-badge[hidden] {
    display: none;
}

/* Step 6: conversation view and unread messages */

.registrar-chat-popup {
    max-width: 680px;
}

.registrar-chat-workspace {
    margin-bottom: 14px;
}

.registrar-chat-chooser {
    width: 100%;
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid #AABBAA;
    border-radius: 4px;
    background: #FFFFFF;
    color: #1A2528;
    font: inherit;
}

.registrar-chat-history {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 120px;
    max-height: 330px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #C2D2C2;
    border-radius: 4px;
    background: #FFFFFF;
    box-sizing: border-box;
}

.registrar-chat-empty {
    margin: auto;
    color: #666666;
    text-align: center;
}

.registrar-chat-message {
    width: fit-content;
    max-width: 82%;
    padding: 9px 11px;
    border-radius: 10px;
    box-sizing: border-box;
    line-height: 1.4;
    word-break: break-word;
}

.registrar-chat-message--own {
    align-self: flex-end;
    background: #D9F1FF;
}

.registrar-chat-message--other {
    align-self: flex-start;
    background: #E9F5E9;
}

.registrar-chat-message strong {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
}

.registrar-chat-message-text {
    white-space: pre-wrap;
}

.registrar-chat-message small {
    display: block;
    margin-top: 5px;
    color: #666666;
    font-size: 10px;
}

.registrar-chat-popup textarea:disabled {
    background: #EEEEEE;
    cursor: not-allowed;
}

.registrar-chat-actions .cta-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .registrar-chat-popup {
        max-width: 95vw;
    }

    .registrar-chat-history {
        max-height: 280px;
    }

    .registrar-chat-message {
        max-width: 92%;
    }
}

/* Step 8: End Chat */

.registrar-chat-end {
    background: #B71C1C;
    color: #FFFFFF;
}

.registrar-chat-end:hover,
.registrar-chat-end:focus {
    background: #8E0000;
    color: #FFFFFF;
}

.registrar-chat-end:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
